java.lang.Object
org.elasticsearch.cluster.service.TaskBatcher
Batching support for
PrioritizedEsThreadPoolExecutor
Tasks that share the same batching key are batched (see TaskBatcher.BatchedTask.batchingKey
)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Represents a runnable task that supports batching. -
Constructor Summary
ConstructorsConstructorDescriptionTaskBatcher
(org.apache.logging.log4j.Logger logger, PrioritizedEsThreadPoolExecutor threadExecutor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
onTimeout
(TaskBatcher.BatchedTask task, TimeValue timeout) Action to be implemented by the specific batching implementation.protected abstract void
run
(Object batchingKey, List<? extends TaskBatcher.BatchedTask> tasks, BatchSummary tasksSummarySupplier) Action to be implemented by the specific batching implementation All tasks have the given batching key.void
submitTask
(TaskBatcher.BatchedTask task, TimeValue timeout)
-
Constructor Details
-
TaskBatcher
public TaskBatcher(org.apache.logging.log4j.Logger logger, PrioritizedEsThreadPoolExecutor threadExecutor)
-
-
Method Details
-
submitTask
public void submitTask(TaskBatcher.BatchedTask task, @Nullable TimeValue timeout) throws EsRejectedExecutionException - Throws:
EsRejectedExecutionException
-
onTimeout
Action to be implemented by the specific batching implementation. All tasks have the same batching key. -
run
protected abstract void run(Object batchingKey, List<? extends TaskBatcher.BatchedTask> tasks, BatchSummary tasksSummarySupplier) Action to be implemented by the specific batching implementation All tasks have the given batching key.
-