Class StageStateMachine

java.lang.Object
io.trino.execution.StageStateMachine

@ThreadSafe public class StageStateMachine extends Object
  • Constructor Details

  • Method Details

    • getStageId

      public StageId getStageId()
    • getState

      public StageState getState()
    • getFragment

      public PlanFragment 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 leaking this when 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

      public boolean transitionToFailed(Throwable throwable)
    • 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 leaking this when adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution.
    • setAllTasksFinal

      public void setAllTasksFinal(Iterable<TaskInfo> finalTaskInfos)
    • getUserMemoryReservation

      public long getUserMemoryReservation()
    • getTotalMemoryReservation

      public long getTotalMemoryReservation()
    • updateMemoryUsage

      public void updateMemoryUsage(long deltaUserMemoryInBytes, long deltaRevocableMemoryInBytes, long deltaTotalMemoryInBytes)
    • getBasicStageStats

      public BasicStageStats getBasicStageStats(Supplier<Iterable<TaskInfo>> taskInfosSupplier)
    • getStageInfo

      public StageInfo getStageInfo(Supplier<Iterable<TaskInfo>> taskInfosSupplier)
    • getBasicStageInfo

      public BasicStageInfo getBasicStageInfo(Supplier<Iterable<TaskInfo>> taskInfosSupplier)
    • recordGetSplitTime

      public void recordGetSplitTime(long startNanos)
    • toString

      public String toString()
      Overrides:
      toString in class Object