Interface BulkService

    • Method Detail

      • submit

        String submit​(BulkCommand command)
        Submits a BulkCommand that will be processed asynchronously, even if the current transaction rolls back (the method is not transactional).
        Parameters:
        command - the command to submit
        Returns:
        a unique bulk command identifier
        Throws:
        IllegalArgumentException - when the command is invalid
        IllegalStateException - when the bulk action is exclusive and another one is already running
      • submitTransactional

        String submitTransactional​(BulkCommand command)
        Submits a BulkCommand that will be processed asynchronously only if the transaction commits successfully (nothing will be submitted in case of transaction rollback). Note that the AsyncService.getStatus(Serializable) will return an unknown state until transaction is committed.
        Parameters:
        command - the command to submit
        Returns:
        a unique bulk command identifier
        Since:
        2021.18
      • getCommand

        BulkCommand getCommand​(String commandId)
        Returns the command or null if the command is not found or aborted.
      • await

        boolean await​(String commandId,
                      Duration duration)
               throws InterruptedException
        Waits for completion of given bulk command.
        Parameters:
        commandId - the command to wait
        duration - the duration to wait
        Returns:
        true if bulk command completed or false if computation has not finished after the timeout
        Throws:
        InterruptedException
      • await

        boolean await​(Duration duration)
               throws InterruptedException
        Waits for completion of all bulk commands.
        Parameters:
        duration - the duration to wait
        Returns:
        true if all bulk commands completed or false if one or more has not finished after the timeout
        Throws:
        InterruptedException
        Since:
        10.3
      • getStatuses

        List<BulkStatus> getStatuses​(String username)
        Gets the list of action statuses triggered by the given user.
        Parameters:
        username - the user name
        Returns:
        the list of statuses
        Since:
        10.3
      • appendExternalBucket

        void appendExternalBucket​(BulkBucket bucket)
        Sends a BulkBucket to the right bulk action.

        This method is useful to produce bucket externally when using an external scroller.

        Parameters:
        bucket - the bucket to send to a bulk action
        Since:
        11.3
      • completeExternalScroll

        void completeExternalScroll​(String commandId,
                                    long count)
        Completes a running bulk computation having an external scroller.
        Parameters:
        commandId - the command id
        count - the total number of elements produced by the external scroller
        Since:
        11.3