Class TaskBatcher
- java.lang.Object
-
- org.elasticsearch.cluster.service.TaskBatcher
-
public abstract class TaskBatcher extends Object
Batching support forPrioritizedEsThreadPoolExecutorTasks that share the same batching key are batched (seeTaskBatcher.BatchedTask.batchingKey)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classTaskBatcher.BatchedTaskRepresents a runnable task that supports batching.
-
Constructor Summary
Constructors Constructor Description TaskBatcher(org.apache.logging.log4j.Logger logger, PrioritizedEsThreadPoolExecutor threadExecutor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidonTimeout(List<? extends TaskBatcher.BatchedTask> tasks, TimeValue timeout)Action to be implemented by the specific batching implementation.protected abstract voidrun(Object batchingKey, List<? extends TaskBatcher.BatchedTask> tasks, String tasksSummary)Action to be implemented by the specific batching implementation All tasks have the given batching key.voidsubmitTasks(List<? extends TaskBatcher.BatchedTask> tasks, TimeValue timeout)
-
-
-
Constructor Detail
-
TaskBatcher
public TaskBatcher(org.apache.logging.log4j.Logger logger, PrioritizedEsThreadPoolExecutor threadExecutor)
-
-
Method Detail
-
submitTasks
public void submitTasks(List<? extends TaskBatcher.BatchedTask> tasks, @Nullable TimeValue timeout) throws EsRejectedExecutionException
- Throws:
EsRejectedExecutionException
-
onTimeout
protected abstract void onTimeout(List<? extends TaskBatcher.BatchedTask> tasks, TimeValue timeout)
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, String tasksSummary)
Action to be implemented by the specific batching implementation All tasks have the given batching key.
-
-