Package io.prestosql.execution
Class TaskStateMachine
- java.lang.Object
-
- io.prestosql.execution.TaskStateMachine
-
@ThreadSafe public class TaskStateMachine extends Object
-
-
Constructor Summary
Constructors Constructor Description TaskStateMachine(TaskId taskId, Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
void
addStateChangeListener(StateMachine.StateChangeListener<TaskState> stateChangeListener)
Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthis
when adding a listener in a constructor.void
cancel()
void
failed(Throwable cause)
void
finished()
org.joda.time.DateTime
getCreatedTime()
LinkedBlockingQueue<Throwable>
getFailureCauses()
TaskState
getState()
com.google.common.util.concurrent.ListenableFuture<TaskState>
getStateChange(TaskState currentState)
TaskId
getTaskId()
String
toString()
void
transitionToFlushing()
-
-
-
Method Detail
-
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)
-
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 leakingthis
when adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution.
-
-