@InterfaceAudience.Private public class UpdatePeerConfigProcedure extends ModifyPeerProcedure
StateMachineProcedure.Flow
Procedure.LockState
PeerProcedureInterface.PeerOperationType
Modifier and Type | Field and Description |
---|---|
private boolean |
enabled |
private static org.slf4j.Logger |
LOG |
private ReplicationPeerConfig |
oldPeerConfig |
private ReplicationPeerConfig |
peerConfig |
SLEEP_INTERVAL_MS, UPDATE_LAST_SEQ_ID_BATCH_SIZE
latch, peerId
stateCount
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
UpdatePeerConfigProcedure() |
UpdatePeerConfigProcedure(String peerId,
ReplicationPeerConfig peerConfig) |
Modifier and Type | Method and Description |
---|---|
private void |
addToList(List<String> encodedRegionNames,
String encodedRegionName,
ReplicationQueueStorage queueStorage) |
protected void |
deserializeStateData(ProcedureStateSerializer serializer)
Called on store load to allow the user to decode the previously serialized
state.
|
protected boolean |
enablePeerBeforeFinish()
The implementation class should override this method if the procedure may enter the serial
related states.
|
protected ReplicationPeerConfig |
getNewPeerConfig() |
protected ReplicationPeerConfig |
getOldPeerConfig() |
PeerProcedureInterface.PeerOperationType |
getPeerOperationType() |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState |
nextStateAfterRefresh()
Implementation class can override this method.
|
protected void |
postPeerModification(MasterProcedureEnv env)
Called before we finish the procedure.
|
protected void |
prePeerModification(MasterProcedureEnv env)
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 |
updateLastPushedSequenceIdForSerialPeer(MasterProcedureEnv env) |
protected void |
updatePeerStorage(MasterProcedureEnv env) |
enablePeer, executeFromState, getInitialState, getState, getStateId, reopenRegions, rollbackState, setLastPushedSequenceId, setLastPushedSequenceIdForTable, setTimeoutFailure
acquireLock, getLatch, getPeerId, holdLock, releaseLock, waitInitialized
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
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, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
private static final org.slf4j.Logger LOG
private ReplicationPeerConfig peerConfig
private ReplicationPeerConfig oldPeerConfig
private boolean enabled
public UpdatePeerConfigProcedure()
public UpdatePeerConfigProcedure(String peerId, ReplicationPeerConfig peerConfig)
public PeerProcedureInterface.PeerOperationType getPeerOperationType()
private void addToList(List<String> encodedRegionNames, String encodedRegionName, ReplicationQueueStorage queueStorage) throws ReplicationException
ReplicationException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState nextStateAfterRefresh()
ModifyPeerProcedure
nextStateAfterRefresh
in class ModifyPeerProcedure
protected void updateLastPushedSequenceIdForSerialPeer(MasterProcedureEnv env) throws IOException, ReplicationException
updateLastPushedSequenceIdForSerialPeer
in class ModifyPeerProcedure
IOException
ReplicationException
protected boolean enablePeerBeforeFinish()
ModifyPeerProcedure
enablePeerBeforeFinish
in class ModifyPeerProcedure
protected ReplicationPeerConfig getOldPeerConfig()
getOldPeerConfig
in class ModifyPeerProcedure
protected ReplicationPeerConfig getNewPeerConfig()
getNewPeerConfig
in class ModifyPeerProcedure
protected void prePeerModification(MasterProcedureEnv env) throws IOException
ModifyPeerProcedure
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.
prePeerModification
in class ModifyPeerProcedure
IOException
protected void updatePeerStorage(MasterProcedureEnv env) throws ReplicationException
updatePeerStorage
in class ModifyPeerProcedure
ReplicationException
protected void postPeerModification(MasterProcedureEnv env) throws IOException, ReplicationException
ModifyPeerProcedure
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. If
ReplicationException
is thrown we will retry since this usually means we fails to
update the peer storage.
postPeerModification
in class ModifyPeerProcedure
IOException
ReplicationException
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class AbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class AbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
serializer
- contains the serialized stateIOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.