Interface BatchExecutorBase<E extends BatchExecutorBase<E,​T>,​T extends BatchCommand<E,​T>>

  • Type Parameters:
    E - type of the BatchExecutorBase
    T - type of the BatchCommand to be executed by the executor implementation
    All Known Implementing Classes:
    BatchExecutor, BatchInsertIntoAutoTrail.Executor

    public interface BatchExecutorBase<E extends BatchExecutorBase<E,​T>,​T extends BatchCommand<E,​T>>
    Base interface of a BatchExecutor. A batch executor is responsible to process a batch of BatchCommands. A batcher is responsible to collect a batch of commands and call their executor to execute the batch.
    • Method Detail

      • doExec

        void doExec​(java.util.Collection<BatchCommand<E,​T>> commands,
                    java.sql.Connection connection)
             throws java.lang.Exception
        Executes a batch of commands
        Parameters:
        commands - the batch of commands is collected by the batcher and passed in to this method which can then execute them all in one batch.
        connection - the connection to work on
        Throws:
        java.lang.Exception - any kind of uncaught exception with the implementation of the executor
      • preferredBatchSize

        int preferredBatchSize()
        Returns:
        Preferred batch size of this executor
      • maximumBatchSize

        int maximumBatchSize()
        Returns:
        the maximum batch size of this executor
      • prioritize

        boolean prioritize()
      • id

        java.lang.String id()
        Returns:
        unique ID of this batcher.