Class TaskStateMachine


  • @ThreadSafe
    public class TaskStateMachine
    extends Object
    • Constructor Detail

      • TaskStateMachine

        public TaskStateMachine​(TaskId taskId,
                                Executor executor)
    • Method Detail

      • getCreatedTime

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

        public TaskId getTaskId()
      • getStateChange

        public com.google.common.util.concurrent.ListenableFuture<TaskState> getStateChange​(TaskState currentState)
      • 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 leaking this when adding a listener in a constructor. Additionally, it is possible notifications are observed out of order due to the asynchronous execution.