Package io.trino.execution
Class StageStateMachine
java.lang.Object
io.trino.execution.StageStateMachine
-
Constructor Summary
ConstructorsConstructorDescriptionStageStateMachine(StageId stageId, PlanFragment fragment, Map<PlanNodeId, TableInfo> tables, Executor executor, io.opentelemetry.api.trace.Tracer tracer, io.opentelemetry.api.trace.Span querySpan, SplitSchedulerStats schedulerStats) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFinalStageInfoListener(StateMachine.StateChangeListener<StageInfo> finalStatusListener) Add a listener for the final stage info.voidaddStateChangeListener(StateMachine.StateChangeListener<StageState> stateChangeListener) Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor.getBasicStageStats(Supplier<Iterable<TaskInfo>> taskInfosSupplier) getStageInfo(Supplier<Iterable<TaskInfo>> taskInfosSupplier) io.opentelemetry.api.trace.SpangetState()longlongvoidrecordGetSplitTime(long startNanos) voidsetAllTasksFinal(Iterable<TaskInfo> finalTaskInfos) toString()booleanbooleantransitionToFailed(Throwable throwable) booleanbooleanbooleanbooleanvoidupdateMemoryUsage(long deltaUserMemoryInBytes, long deltaRevocableMemoryInBytes, long deltaTotalMemoryInBytes)
-
Constructor Details
-
StageStateMachine
public StageStateMachine(StageId stageId, PlanFragment fragment, Map<PlanNodeId, TableInfo> tables, Executor executor, io.opentelemetry.api.trace.Tracer tracer, io.opentelemetry.api.trace.Span querySpan, SplitSchedulerStats schedulerStats)
-
-
Method Details
-
getStageId
-
getState
-
getFragment
-
getStageSpan
public io.opentelemetry.api.trace.Span getStageSpan() -
addStateChangeListener
public void addStateChangeListener(StateMachine.StateChangeListener<StageState> stateChangeListener) Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution. -
transitionToScheduling
public boolean transitionToScheduling() -
transitionToRunning
public boolean transitionToRunning() -
transitionToPending
public boolean transitionToPending() -
transitionToFinished
public boolean transitionToFinished() -
transitionToAborted
public boolean transitionToAborted() -
transitionToFailed
-
addFinalStageInfoListener
public void addFinalStageInfoListener(StateMachine.StateChangeListener<StageInfo> finalStatusListener) Add a listener for the final stage info. This notification is guaranteed to be fired only once. Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution. -
setAllTasksFinal
-
getUserMemoryReservation
public long getUserMemoryReservation() -
getTotalMemoryReservation
public long getTotalMemoryReservation() -
updateMemoryUsage
public void updateMemoryUsage(long deltaUserMemoryInBytes, long deltaRevocableMemoryInBytes, long deltaTotalMemoryInBytes) -
getBasicStageStats
-
getStageInfo
-
recordGetSplitTime
public void recordGetSplitTime(long startNanos) -
toString
-