@InterfaceAudience.Private public abstract class ModifyPeerProcedure extends AbstractPeerProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
StateMachineProcedure.Flow
Procedure.LockState
PeerProcedureInterface.PeerOperationType
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
latch, SLEEP_INTERVAL_MS, UPDATE_LAST_SEQ_ID_BATCH_SIZE
peerId
stateCount
NO_PROC_ID, NO_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
ModifyPeerProcedure() |
protected |
ModifyPeerProcedure(String peerId) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
enablePeerBeforeFinish()
The implementation class should override this method if the procedure may enter the serial
related states.
|
protected StateMachineProcedure.Flow |
executeFromState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected ReplicationPeerConfig |
getNewPeerConfig() |
protected ReplicationPeerConfig |
getOldPeerConfig() |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
private boolean |
needReopen(TableStateManager tsm,
TableName tn) |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState |
nextStateAfterRefresh()
Implementation class can override this method.
|
protected abstract void |
postPeerModification(MasterProcedureEnv env)
Called before we finish the procedure.
|
protected abstract void |
prePeerModification(MasterProcedureEnv env)
Called before we start the actual processing.
|
protected void |
releaseLatch(MasterProcedureEnv env) |
protected void |
reopenRegions(MasterProcedureEnv env) |
private boolean |
shouldFailForMigrating(MasterProcedureEnv env) |
protected void |
updateLastPushedSequenceIdForSerialPeer(MasterProcedureEnv env) |
protected abstract void |
updatePeerStorage(MasterProcedureEnv env) |
acquireLock, checkPeerModificationEnabled, enablePeer, getLatch, holdLock, refreshPeer, releaseLock, setLastPushedSequenceId, setLastPushedSequenceIdForTable
deserializeStateData, getPeerId, resetRetry, rollbackState, serializeStateData, setTimeoutFailure, suspend, waitInitialized
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, 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, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPeerId, getPeerOperationType
private static final org.slf4j.Logger LOG
protected ModifyPeerProcedure()
protected ModifyPeerProcedure(String peerId)
protected abstract void prePeerModification(MasterProcedureEnv env) throws IOException, ReplicationException, ProcedureSuspendedException
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.
protected abstract void updatePeerStorage(MasterProcedureEnv env) throws ReplicationException
ReplicationException
protected abstract void postPeerModification(MasterProcedureEnv env) throws IOException, ReplicationException, ProcedureSuspendedException
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.
protected void releaseLatch(MasterProcedureEnv env)
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState nextStateAfterRefresh()
protected boolean enablePeerBeforeFinish()
protected ReplicationPeerConfig getOldPeerConfig()
protected ReplicationPeerConfig getNewPeerConfig()
protected void updateLastPushedSequenceIdForSerialPeer(MasterProcedureEnv env) throws IOException, ReplicationException
IOException
ReplicationException
private boolean needReopen(TableStateManager tsm, TableName tn) throws IOException
IOException
protected void reopenRegions(MasterProcedureEnv env) throws IOException
IOException
private boolean shouldFailForMigrating(MasterProcedureEnv env) throws IOException
IOException
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState state) throws ProcedureSuspendedException, InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
state
- state to executeProcedureSuspendedException
InterruptedException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
state
- the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.PeerModificationState>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.