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:
java.lang.Comparable<PrioritizedRunnable>
,java.lang.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 java.lang.Object
batchingKey
the object that is used as batching keyprotected java.util.concurrent.atomic.AtomicBoolean
processed
whether the task has been processed alreadyprotected java.lang.Object
task
the task object that is wrappedFields inherited from class org.elasticsearch.cluster.service.SourcePrioritizedRunnable
source
-
Constructor Summary
Constructors Modifier Constructor Description protected
BatchedTask(Priority priority, java.lang.String source, java.lang.Object batchingKey, java.lang.Object task)
-
Method Summary
Modifier and Type Method Description abstract java.lang.String
describeTasks(java.util.List<? extends TaskBatcher.BatchedTask> tasks)
java.lang.Object
getTask()
void
run()
java.lang.String
toString()
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
processed
protected final java.util.concurrent.atomic.AtomicBoolean processedwhether the task has been processed already -
batchingKey
protected final java.lang.Object batchingKeythe object that is used as batching key -
task
protected final java.lang.Object taskthe task object that is wrapped
-
-
Constructor Details
-
BatchedTask
protected BatchedTask(Priority priority, java.lang.String source, java.lang.Object batchingKey, java.lang.Object task)
-
-
Method Details
-
run
public void run() -
toString
public java.lang.String toString()- Overrides:
toString
in classSourcePrioritizedRunnable
-
describeTasks
public abstract java.lang.String describeTasks(java.util.List<? extends TaskBatcher.BatchedTask> tasks) -
getTask
public java.lang.Object getTask()
-