Class SqlStage


  • @ThreadSafe
    public final class SqlStage
    extends Object
    This class is merely a container used by coordinator to track tasks for a single stage.

    It is designed to keep track of execution statistics for tasks from the same stage as well as aggregating them and providing a final stage info when the stage execution is completed.

    This class doesn't imply anything about the nature of execution. It is not responsible for scheduling tasks in a certain order, gang scheduling or any other execution primitives.

    • Method Detail

      • getStageId

        public StageId getStageId()
      • finish

        public void finish()
      • abort

        public void abort()
      • fail

        public void fail​(Throwable throwable)
      • addFinalStageInfoListener

        public void addFinalStageInfoListener​(StateMachine.StateChangeListener<StageInfo> stateChangeListener)
        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.
      • getUserMemoryReservation

        public long getUserMemoryReservation()
      • getTotalMemoryReservation

        public long getTotalMemoryReservation()
      • getTotalCpuTime

        public io.airlift.units.Duration getTotalCpuTime()
      • getStageInfo

        public StageInfo getStageInfo()
      • recordGetSplitTime

        public void recordGetSplitTime​(long start)