Class DeterministicTaskQueue
java.lang.Object
org.elasticsearch.cluster.coordination.DeterministicTaskQueue
-
Constructor Summary
ConstructorsConstructorDescriptionDeterministicTaskQueue(org.elasticsearch.common.settings.Settings settings, Random random)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Advance the current time to the time of the next deferred task, and update the sets of deferred and runnable tasks accordingly.long
long
long
org.elasticsearch.threadpool.ThreadPool
org.elasticsearch.threadpool.ThreadPool
getThreadPool(Function<Runnable,Runnable> runnableWrapper)
boolean
boolean
void
void
void
void
Runs an arbitrary runnable task.void
scheduleAt(long executionTimeMillis, Runnable task)
Schedule a task for future execution.void
scheduleNow(Runnable task)
Schedule a task for immediate execution.void
setExecutionDelayVariabilityMillis(long executionDelayVariabilityMillis)
-
Constructor Details
-
DeterministicTaskQueue
-
-
Method Details
-
getExecutionDelayVariabilityMillis
public long getExecutionDelayVariabilityMillis() -
setExecutionDelayVariabilityMillis
public void setExecutionDelayVariabilityMillis(long executionDelayVariabilityMillis) -
runAllRunnableTasks
public void runAllRunnableTasks() -
runAllTasks
public void runAllTasks() -
runAllTasksInTimeOrder
public void runAllTasksInTimeOrder() -
hasRunnableTasks
public boolean hasRunnableTasks()- Returns:
- whether there are any runnable tasks.
-
hasDeferredTasks
public boolean hasDeferredTasks()- Returns:
- whether there are any deferred tasks, i.e. tasks that are scheduled for the future.
-
getCurrentTimeMillis
public long getCurrentTimeMillis()- Returns:
- the current (simulated) time, in milliseconds.
-
runRandomTask
public void runRandomTask()Runs an arbitrary runnable task. -
scheduleNow
Schedule a task for immediate execution. -
scheduleAt
Schedule a task for future execution. -
advanceTime
public void advanceTime()Advance the current time to the time of the next deferred task, and update the sets of deferred and runnable tasks accordingly. -
getThreadPool
public org.elasticsearch.threadpool.ThreadPool getThreadPool()- Returns:
- A
ThreadPool
that uses this task queue.
-
getThreadPool
public org.elasticsearch.threadpool.ThreadPool getThreadPool(Function<Runnable,Runnable> runnableWrapper)- Returns:
- A
ThreadPool
that uses this task queue and wrapsRunnable
s in the given wrapper.
-
getLatestDeferredExecutionTime
public long getLatestDeferredExecutionTime()
-