Class UpdatePeerConfigProcedure
java.lang.Object
org.apache.hadoop.hbase.procedure2.Procedure<TEnvironment>
org.apache.hadoop.hbase.procedure2.StateMachineProcedure<MasterProcedureEnv,TState>
org.apache.hadoop.hbase.master.replication.AbstractPeerNoLockProcedure<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.UpdatePeerConfigProcedure
- All Implemented Interfaces:
Comparable<Procedure<MasterProcedureEnv>>,PeerProcedureInterface
The procedure for updating the config for a replication peer.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
StateMachineProcedure.FlowNested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.Procedure
Procedure.LockStateNested classes/interfaces inherited from interface org.apache.hadoop.hbase.master.procedure.PeerProcedureInterface
PeerProcedureInterface.PeerOperationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final org.slf4j.Loggerprivate ReplicationPeerConfigprivate ReplicationPeerConfigFields inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure
latch, SLEEP_INTERVAL_MS, UPDATE_LAST_SEQ_ID_BATCH_SIZEFields inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerNoLockProcedure
peerIdFields inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
stateCountFields inherited from class org.apache.hadoop.hbase.procedure2.Procedure
NO_PROC_ID, NO_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToList(List<String> encodedRegionNames, String encodedRegionName, ReplicationQueueStorage queueStorage) protected voiddeserializeStateData(ProcedureStateSerializer serializer) Called on store load to allow the user to decode the previously serialized state.protected booleanThe implementation class should override this method if the procedure may enter the serial related states.protected ReplicationPeerConfigprotected ReplicationPeerConfigprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationStateImplementation class can override this method.protected voidCalled before we finish the procedure.protected voidCalled before we start the actual processing.protected voidserializeStateData(ProcedureStateSerializer serializer) The user-level code of the procedure may have some state to persist (e.g.protected voidprotected voidMethods inherited from class org.apache.hadoop.hbase.master.replication.ModifyPeerProcedure
executeFromState, getInitialState, getState, getStateId, releaseLatch, reopenRegionsMethods inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure
acquireLock, checkPeerModificationEnabled, enablePeer, getLatch, holdLock, refreshPeer, releaseLock, setLastPushedSequenceId, setLastPushedSequenceIdForTableMethods inherited from class org.apache.hadoop.hbase.master.replication.AbstractPeerNoLockProcedure
getPeerId, resetRetry, rollbackState, setTimeoutFailure, suspend, waitInitializedMethods inherited from class org.apache.hadoop.hbase.procedure2.StateMachineProcedure
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateMethods inherited from class org.apache.hadoop.hbase.procedure2.Procedure
addStackIndex, afterExec, afterReplay, beforeExec, 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, wasExecutedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.master.procedure.PeerProcedureInterface
getPeerId
-
Field Details
-
LOG
-
peerConfig
-
oldPeerConfig
-
enabled
-
-
Constructor Details
-
UpdatePeerConfigProcedure
public UpdatePeerConfigProcedure() -
UpdatePeerConfigProcedure
-
-
Method Details
-
getPeerOperationType
-
addToList
private void addToList(List<String> encodedRegionNames, String encodedRegionName, ReplicationQueueStorage queueStorage) throws ReplicationException - Throws:
ReplicationException
-
nextStateAfterRefresh
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState nextStateAfterRefresh()Description copied from class:ModifyPeerProcedureImplementation class can override this method. By default we will jump to POST_PEER_MODIFICATION and finish the procedure.- Overrides:
nextStateAfterRefreshin classModifyPeerProcedure
-
updateLastPushedSequenceIdForSerialPeer
protected void updateLastPushedSequenceIdForSerialPeer(MasterProcedureEnv env) throws IOException, ReplicationException - Overrides:
updateLastPushedSequenceIdForSerialPeerin classModifyPeerProcedure- Throws:
IOExceptionReplicationException
-
enablePeerBeforeFinish
Description copied from class:ModifyPeerProcedureThe implementation class should override this method if the procedure may enter the serial related states.- Overrides:
enablePeerBeforeFinishin classModifyPeerProcedure
-
getOldPeerConfig
- Overrides:
getOldPeerConfigin classModifyPeerProcedure
-
getNewPeerConfig
- Overrides:
getNewPeerConfigin classModifyPeerProcedure
-
prePeerModification
Description copied from class:ModifyPeerProcedureCalled 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:
prePeerModificationin classModifyPeerProcedure- Throws:
IOException
-
updatePeerStorage
- Specified by:
updatePeerStoragein classModifyPeerProcedure- Throws:
ReplicationException
-
postPeerModification
protected void postPeerModification(MasterProcedureEnv env) throws IOException, ReplicationException Description copied from class:ModifyPeerProcedureCalled 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
IOExceptionhere will not fail this procedure, we will just ignore it and finish the procedure as suceeded. IfReplicationExceptionis thrown we will retry since this usually means we fails to update the peer storage.- Specified by:
postPeerModificationin classModifyPeerProcedure- Throws:
IOExceptionReplicationException
-
serializeStateData
Description copied from class:ProcedureThe 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:
serializeStateDatain classAbstractPeerNoLockProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>- Parameters:
serializer- stores the serializable state- Throws:
IOException
-
deserializeStateData
Description copied from class:ProcedureCalled on store load to allow the user to decode the previously serialized state.- Overrides:
deserializeStateDatain classAbstractPeerNoLockProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>- Parameters:
serializer- contains the serialized state- Throws:
IOException
-