Package io.trino.execution.executor
Class PrioritizedSplitRunner
- java.lang.Object
-
- io.trino.execution.executor.PrioritizedSplitRunner
-
- All Implemented Interfaces:
Comparable<PrioritizedSplitRunner>
public class PrioritizedSplitRunner extends Object implements Comparable<PrioritizedSplitRunner>
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicLonglastRunprotected AtomicReference<Priority>prioritystatic io.airlift.units.DurationSPLIT_RUN_QUANTA
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PrioritizedSplitRunner o)voiddestroy()longgetCpuTimeNanos()longgetCreatedNanos()com.google.common.util.concurrent.ListenableFuture<Void>getFinishedFuture()StringgetInfo()PrioritygetPriority()longgetScheduledNanos()intgetSplitId()TaskHandlegetTaskHandle()longgetWaitNanos()booleanisDestroyed()booleanisFinished()com.google.common.util.concurrent.ListenableFuture<Void>process()voidresetLevelPriority()Updates the task level priority to be greater than or equal to the minimum priority within that level.voidsetReady()StringtoString()booleanupdateLevelPriority()Updates the (potentially stale) priority value cached in this object.
-
-
-
Field Detail
-
SPLIT_RUN_QUANTA
public static final io.airlift.units.Duration SPLIT_RUN_QUANTA
-
priority
protected final AtomicReference<Priority> priority
-
lastRun
protected final AtomicLong lastRun
-
-
Method Detail
-
getTaskHandle
public TaskHandle getTaskHandle()
-
getFinishedFuture
public com.google.common.util.concurrent.ListenableFuture<Void> getFinishedFuture()
-
isDestroyed
public boolean isDestroyed()
-
destroy
public void destroy()
-
getCreatedNanos
public long getCreatedNanos()
-
isFinished
public boolean isFinished()
-
getScheduledNanos
public long getScheduledNanos()
-
getCpuTimeNanos
public long getCpuTimeNanos()
-
getWaitNanos
public long getWaitNanos()
-
process
public com.google.common.util.concurrent.ListenableFuture<Void> process()
-
setReady
public void setReady()
-
updateLevelPriority
public boolean updateLevelPriority()
Updates the (potentially stale) priority value cached in this object. This should be called when this object is outside the queue.- Returns:
- true if the level changed.
-
resetLevelPriority
public void resetLevelPriority()
Updates the task level priority to be greater than or equal to the minimum priority within that level. This ensures that tasks that spend time blocked do not return and starve already-running tasks. Also updates the cached priority object.
-
compareTo
public int compareTo(PrioritizedSplitRunner o)
- Specified by:
compareToin interfaceComparable<PrioritizedSplitRunner>
-
getSplitId
public int getSplitId()
-
getPriority
public Priority getPriority()
-
getInfo
public String getInfo()
-
-