@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class SequentialProcedure<TEnvironment> extends Procedure<TEnvironment>
-> Step 1 -> Step 2 -> Step 3The main difference from a base Procedure is that the execute() of a SequentialProcedure will be called only once; there will be no second execute() call once the children are finished. which means once the child of a SequentialProcedure are completed the SequentialProcedure is completed too.
Procedure.LockState
Modifier and Type | Field and Description |
---|---|
private boolean |
executed |
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
SequentialProcedure() |
Modifier and Type | Method and Description |
---|---|
protected void |
deserializeStateData(ProcedureStateSerializer serializer)
Called on store load to allow the user to decode the previously serialized
state.
|
protected Procedure[] |
doExecute(TEnvironment env)
Internal method called by the ProcedureExecutor that starts the user-level code execute().
|
protected void |
doRollback(TEnvironment env)
Internal method called by the ProcedureExecutor that starts the user-level code rollback().
|
protected void |
serializeStateData(ProcedureStateSerializer serializer)
The user-level code of the procedure may have some state to
persist (e.g.
|
abort, acquireLock, addStackIndex, afterReplay, beforeReplay, bypass, compareTo, completionCleanup, doAcquireLock, doReleaseLock, elapsedTime, execute, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcedureMetrics, getProcId, getProcIdHashCode, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasOwner, hasParent, hasTimeout, haveSameParent, holdLock, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, lockedWhenLoading, needPersistence, releaseLock, removeStackIndex, resetPersistence, restoreLock, rollback, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, tryRunnable, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
private boolean executed
public SequentialProcedure()
protected Procedure[] doExecute(TEnvironment env) throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException
Procedure
doExecute
in class Procedure<TEnvironment>
ProcedureSuspendedException
- This is used when procedure wants to halt processing and
skip out without changing states or releasing any locks held.ProcedureYieldException
InterruptedException
protected void doRollback(TEnvironment env) throws IOException, InterruptedException
Procedure
doRollback
in class Procedure<TEnvironment>
IOException
InterruptedException
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class Procedure<TEnvironment>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class Procedure<TEnvironment>
serializer
- contains the serialized stateIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.