Class TaskStateMachine

java.lang.Object
io.trino.execution.TaskStateMachine

@ThreadSafe public class TaskStateMachine extends Object
  • Constructor Details

    • TaskStateMachine

      public TaskStateMachine(TaskId taskId, Executor executor)
  • Method Details

    • getCreatedTime

      public org.joda.time.DateTime getCreatedTime()
    • getTaskId

      public TaskId getTaskId()
    • getState

      public TaskState getState()
    • getStateChange

      public com.google.common.util.concurrent.ListenableFuture<TaskState> getStateChange(TaskState currentState)
    • getFailureCauses

      public LinkedBlockingQueue<Throwable> getFailureCauses()
    • transitionToFlushing

      public void transitionToFlushing()
    • finished

      public void finished()
    • cancel

      public void cancel()
    • abort

      public void abort()
    • failed

      public void failed(Throwable cause)
    • terminationComplete

      public void terminationComplete()
    • addStateChangeListener

      public void addStateChangeListener(StateMachine.StateChangeListener<TaskState> 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.
    • addSourceTaskFailureListener

      public void addSourceTaskFailureListener(TaskFailureListener listener)
    • sourceTaskFailed

      public void sourceTaskFailed(TaskId taskId, Throwable failure)
    • toString

      public String toString()
      Overrides:
      toString in class Object