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