Class TaskBatcher.BatchedTask
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.PrioritizedRunnable
-
- org.elasticsearch.cluster.service.SourcePrioritizedRunnable
-
- org.elasticsearch.cluster.service.TaskBatcher.BatchedTask
-
- All Implemented Interfaces:
Comparable<PrioritizedRunnable>,Runnable
- Enclosing class:
- TaskBatcher
protected abstract class TaskBatcher.BatchedTask extends SourcePrioritizedRunnable
Represents a runnable task that supports batching. Implementors of TaskBatcher can subclass this to add a payload to the task.
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectbatchingKeythe object that is used as batching keyprotected AtomicBooleanprocessedwhether the task has been processed alreadyprotected Objecttaskthe task object that is wrapped-
Fields inherited from class org.elasticsearch.cluster.service.SourcePrioritizedRunnable
source
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBatchedTask(Priority priority, String source, Object batchingKey, Object task)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringdescribeTasks(List<? extends TaskBatcher.BatchedTask> tasks)ObjectgetTask()voidrun()StringtoString()-
Methods inherited from class org.elasticsearch.cluster.service.SourcePrioritizedRunnable
source
-
Methods inherited from class org.elasticsearch.common.util.concurrent.PrioritizedRunnable
compareTo, getAgeInMillis, getCreationDateInNanos, priority, wrap
-
-
-
-
Field Detail
-
processed
protected final AtomicBoolean processed
whether the task has been processed already
-
batchingKey
protected final Object batchingKey
the object that is used as batching key
-
task
protected final Object task
the task object that is wrapped
-
-
Method Detail
-
run
public void run()
-
toString
public String toString()
- Overrides:
toStringin classSourcePrioritizedRunnable
-
describeTasks
public abstract String describeTasks(List<? extends TaskBatcher.BatchedTask> tasks)
-
getTask
public Object getTask()
-
-