Class EnablePeerProcedure
java.lang.Object
org.apache.hadoop.hbase.procedure2.Procedure<TEnvironment>
org.apache.hadoop.hbase.procedure2.StateMachineProcedure<MasterProcedureEnv,TState>
org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
org.apache.hadoop.hbase.master.replication.ModifyPeerProcedure
org.apache.hadoop.hbase.master.replication.EnablePeerProcedure
- All Implemented Interfaces:
Comparable<Procedure<MasterProcedureEnv>>
,PeerProcedureInterface
The procedure for enabling a replication peer.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
StateMachineProcedure.Flow
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.Procedure
Procedure.LockState
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.master.procedure.PeerProcedureInterface
PeerProcedureInterface.PeerOperationType
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.master.replication.ModifyPeerProcedure
SLEEP_INTERVAL_MS, UPDATE_LAST_SEQ_ID_BATCH_SIZE
Fields inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure
latch, peerId
Fields inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
stateCount
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 void
Called before we finish the procedure.protected void
Called before we start the actual processing.protected void
serializeStateData
(ProcedureStateSerializer serializer) The user-level code of the procedure may have some state to persist (e.g.protected void
Methods inherited from class org.apache.hadoop.hbase.master.replication.ModifyPeerProcedure
enablePeer, enablePeerBeforeFinish, executeFromState, getInitialState, getNewPeerConfig, getOldPeerConfig, getState, getStateId, nextStateAfterRefresh, reopenRegions, rollbackState, setLastPushedSequenceId, setLastPushedSequenceIdForTable, setTimeoutFailure, updateLastPushedSequenceIdForSerialPeer
Methods inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure
acquireLock, checkPeerModificationEnabled, getLatch, getPeerId, holdLock, releaseLock, waitInitialized
Methods inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
Methods inherited from class org.apache.hadoop.hbase.procedure2.Procedure
addStackIndex, afterReplay, beforeReplay, bypass, compareTo, completionCleanup, doExecute, doRollback, elapsedTime, 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, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, removeStackIndex, setAbortFailure, setChildrenLatch, setExecuted, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, shouldWaitClientAck, skipPersistence, suspend, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
-
Field Details
-
LOG
-
-
Constructor Details
-
EnablePeerProcedure
public EnablePeerProcedure() -
EnablePeerProcedure
-
-
Method Details
-
getPeerOperationType
-
prePeerModification
Description copied from class:ModifyPeerProcedure
Called before we start the actual processing. The implementation should call the pre CP hook, and also the pre-check for the peer modification.If an IOException is thrown then we will give up and mark the procedure as failed directly. If all checks passes then the procedure can not be rolled back any more.
- Specified by:
prePeerModification
in classModifyPeerProcedure
- Throws:
IOException
-
updatePeerStorage
- Specified by:
updatePeerStorage
in classModifyPeerProcedure
- Throws:
ReplicationException
-
postPeerModification
Description copied from class:ModifyPeerProcedure
Called before we finish the procedure. The implementation can do some logging work, and also call the coprocessor hook if any.Notice that, since we have already done the actual work, throwing
IOException
here will not fail this procedure, we will just ignore it and finish the procedure as suceeded. IfReplicationException
is thrown we will retry since this usually means we fails to update the peer storage.- Specified by:
postPeerModification
in classModifyPeerProcedure
- Throws:
IOException
-
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.- Overrides:
serializeStateData
in classAbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
- 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.- Overrides:
deserializeStateData
in classAbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
- Parameters:
serializer
- contains the serialized state- Throws:
IOException
-