public abstract class TaskBatcher
extends java.lang.Object
PrioritizedEsThreadPoolExecutor
Tasks that share the same batching key are batched (see TaskBatcher.BatchedTask.batchingKey
)Modifier and Type | Class and Description |
---|---|
protected class |
TaskBatcher.BatchedTask
Represents a runnable task that supports batching.
|
Constructor and Description |
---|
TaskBatcher(org.apache.logging.log4j.Logger logger,
PrioritizedEsThreadPoolExecutor threadExecutor) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
onTimeout(java.util.List<? extends TaskBatcher.BatchedTask> tasks,
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,
TimeValue timeout) |
public TaskBatcher(org.apache.logging.log4j.Logger logger, PrioritizedEsThreadPoolExecutor threadExecutor)
public void submitTasks(java.util.List<? extends TaskBatcher.BatchedTask> tasks, @Nullable TimeValue timeout) throws EsRejectedExecutionException
EsRejectedExecutionException
protected abstract void onTimeout(java.util.List<? extends TaskBatcher.BatchedTask> tasks, TimeValue timeout)
protected abstract void run(java.lang.Object batchingKey, java.util.List<? extends TaskBatcher.BatchedTask> tasks, java.lang.String tasksSummary)