Class FragmentInstanceStateMachine
- java.lang.Object
-
- org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceStateMachine
-
@ThreadSafe public class FragmentInstanceStateMachine extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FragmentInstanceStateMachine(FragmentInstanceId fragmentInstanceId, java.util.concurrent.Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()voidaddSourceTaskFailureListener(FragmentInstanceFailureListener listener)voidaddStateChangeListener(StateMachine.StateChangeListener<FragmentInstanceState> stateChangeListener)Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen adding a listener in a constructor.voidcancel()voidfailed(java.lang.Throwable cause)voidfinished()longgetCreatedTime()java.util.concurrent.LinkedBlockingQueue<java.lang.Throwable>getFailureCauses()FragmentInstanceIdgetFragmentInstanceId()FragmentInstanceStategetState()com.google.common.util.concurrent.ListenableFuture<FragmentInstanceState>getStateChange(FragmentInstanceState currentState)voidsourceTaskFailed(FragmentInstanceId instanceId, java.lang.Throwable failure)java.lang.StringtoString()voidtransitionToFlushing()
-
-
-
Constructor Detail
-
FragmentInstanceStateMachine
public FragmentInstanceStateMachine(FragmentInstanceId fragmentInstanceId, java.util.concurrent.Executor executor)
-
-
Method Detail
-
getCreatedTime
public long getCreatedTime()
-
getFragmentInstanceId
public FragmentInstanceId getFragmentInstanceId()
-
getState
public FragmentInstanceState getState()
-
getStateChange
public com.google.common.util.concurrent.ListenableFuture<FragmentInstanceState> getStateChange(FragmentInstanceState currentState)
-
getFailureCauses
public java.util.concurrent.LinkedBlockingQueue<java.lang.Throwable> getFailureCauses()
-
transitionToFlushing
public void transitionToFlushing()
-
finished
public void finished()
-
cancel
public void cancel()
-
abort
public void abort()
-
failed
public void failed(java.lang.Throwable cause)
-
addStateChangeListener
public void addStateChangeListener(StateMachine.StateChangeListener<FragmentInstanceState> stateChangeListener)
Listener is always notified asynchronously using a dedicated notification thread pool so, care should be taken to avoid leakingthiswhen 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(FragmentInstanceFailureListener listener)
-
sourceTaskFailed
public void sourceTaskFailed(FragmentInstanceId instanceId, java.lang.Throwable failure)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-