Package org.opensearch.cluster.service
Class TaskBatcher
java.lang.Object
org.opensearch.cluster.service.TaskBatcher
Batching support for
PrioritizedOpenSearchThreadPoolExecutor
Tasks that share the same batching key are batched (see TaskBatcher.BatchedTask.batchingKey
)- Opensearch.internal:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Represents a runnable task that supports batching. -
Constructor Summary
ConstructorsConstructorDescriptionTaskBatcher
(org.apache.logging.log4j.Logger logger, PrioritizedOpenSearchThreadPoolExecutor threadExecutor, TaskBatcherListener taskBatcherListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
onTimeout
(List<? extends TaskBatcher.BatchedTask> tasks, org.opensearch.common.unit.TimeValue timeout) Action to be implemented by the specific batching implementation.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.void
submitTasks
(List<? extends TaskBatcher.BatchedTask> tasks, org.opensearch.common.unit.TimeValue timeout)
-
Constructor Details
-
TaskBatcher
public TaskBatcher(org.apache.logging.log4j.Logger logger, PrioritizedOpenSearchThreadPoolExecutor threadExecutor, TaskBatcherListener taskBatcherListener)
-
-
Method Details
-
submitTasks
public void submitTasks(List<? extends TaskBatcher.BatchedTask> tasks, @Nullable org.opensearch.common.unit.TimeValue timeout) throws org.opensearch.core.concurrency.OpenSearchRejectedExecutionException - Throws:
org.opensearch.core.concurrency.OpenSearchRejectedExecutionException
-
onTimeout
protected abstract void onTimeout(List<? extends TaskBatcher.BatchedTask> tasks, org.opensearch.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(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.
-