All Known Implementing Classes:
AbstractBatchOperation

public interface BatchOperation
A BatchOperation collects together a set of operations that should be executed together as a batch. The implementation of this class should carefully track changes, and take care to not allow mutations during execution. However, it's usually smart to not lock during the entire execution, so one common pattern is to clone the data at the start of exec in a lock, and then operate on that, allowing new data to be accumulated along the way. This batch operation will be reused, so the implementation should carefully manage internal data.
Since:
8.0
  • Method Details

    • getExecDelayMS

      default int getExecDelayMS()
      Returns roughly how long this operation should buffer before executing.
    • setController

      void setController(BatchOperation.BatchContextController controller)
    • getController

    • execute

      void execute(ProviderContext context)
    • executeAndReturnSize

      default long executeAndReturnSize(ProviderContext context)
      Executes the current batch and returns amount of items processed.
      Returns:
      Amount of items processed in execution, or -1 if not implemented.
    • shouldSchedule

      boolean shouldSchedule()
      Indicates that this operation has outstanding data and should be scheduled for execution.