Class SequentialProcedure<TEnvironment>
java.lang.Object
org.apache.hadoop.hbase.procedure2.Procedure<TEnvironment>
org.apache.hadoop.hbase.procedure2.SequentialProcedure<TEnvironment>
- All Implemented Interfaces:
Comparable<Procedure<TEnvironment>>
@Private
@Evolving
public abstract class SequentialProcedure<TEnvironment>
extends Procedure<TEnvironment>
A SequentialProcedure describes one step in a procedure chain:
-> 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.Procedure
Procedure.LockState
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.procedure2.Procedure
NO_PROC_ID, NO_TIMEOUT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.Methods inherited from class org.apache.hadoop.hbase.procedure2.Procedure
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, isRollbackSupported, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, lockedWhenLoading, needPersistence, releaseLock, removeStackIndex, resetPersistence, restoreLock, rollback, setAbortFailure, setChildrenLatch, setExecuted, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, suspend, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, tryRunnable, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
-
Field Details
-
executed
-
-
Constructor Details
-
SequentialProcedure
public SequentialProcedure()
-
-
Method Details
-
doExecute
protected Procedure[] doExecute(TEnvironment env) throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException Description copied from class:Procedure
Internal method called by the ProcedureExecutor that starts the user-level code execute().- Overrides:
doExecute
in classProcedure<TEnvironment>
- Throws:
ProcedureSuspendedException
- This is used when procedure wants to halt processing and skip out without changing states or releasing any locks held.ProcedureYieldException
InterruptedException
-
doRollback
Description copied from class:Procedure
Internal method called by the ProcedureExecutor that starts the user-level code rollback().- Overrides:
doRollback
in classProcedure<TEnvironment>
- Throws:
IOException
InterruptedException
-
serializeStateData
Description copied from class:Procedure
The user-level code of the procedure may have some state to persist (e.g. input arguments or current position in the processing state) to be able to resume on failure.- Specified by:
serializeStateData
in classProcedure<TEnvironment>
- Parameters:
serializer
- stores the serializable state- Throws:
IOException
-
deserializeStateData
Description copied from class:Procedure
Called on store load to allow the user to decode the previously serialized state.- Specified by:
deserializeStateData
in classProcedure<TEnvironment>
- Parameters:
serializer
- contains the serialized state- Throws:
IOException
-