@InterfaceAudience.Private public class AssignReplicationQueuesProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState> implements ServerProcedureInterface
StateMachineProcedure.Flow
Procedure.LockState
ServerProcedureInterface.ServerOperationType
Modifier and Type | Field and Description |
---|---|
private ServerName |
crashedServer |
private static org.slf4j.Logger |
LOG |
private RetryCounter |
retryCounter |
stateCount
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
AssignReplicationQueuesProcedure() |
AssignReplicationQueuesProcedure(ServerName crashedServer) |
Modifier and Type | Method and Description |
---|---|
private void |
addMissingQueues(MasterProcedureEnv env) |
private StateMachineProcedure.Flow |
claimQueues(MasterProcedureEnv env) |
protected void |
deserializeStateData(ProcedureStateSerializer serializer)
Called on store load to allow the user to decode the previously serialized state.
|
protected StateMachineProcedure.Flow |
executeFromState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
ServerName |
getServerName()
Returns Name of this server instance.
|
ServerProcedureInterface.ServerOperationType |
getServerOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState |
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.AssignReplicationQueuesState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
boolean |
hasMetaTableRegion()
Returns True if this server has an hbase:meta table region.
|
private void |
removeQueues(MasterProcedureEnv env) |
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState state)
called to perform the rollback of the specified state
|
protected void |
serializeStateData(ProcedureStateSerializer serializer)
The user-level code of the procedure may have some state to persist (e.g.
|
protected boolean |
setTimeoutFailure(MasterProcedureEnv env)
Called by the ProcedureExecutor when the timeout set by setTimeout() is expired.
|
private boolean |
shouldSkip(MasterProcedureEnv env) |
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
acquireLock, 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, holdLock, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, releaseLock, 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, waitInitialized, wasExecuted
private static final org.slf4j.Logger LOG
private ServerName crashedServer
private RetryCounter retryCounter
public AssignReplicationQueuesProcedure()
public AssignReplicationQueuesProcedure(ServerName crashedServer)
public ServerName getServerName()
ServerProcedureInterface
getServerName
in interface ServerProcedureInterface
public boolean hasMetaTableRegion()
ServerProcedureInterface
hasMetaTableRegion
in interface ServerProcedureInterface
public ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterface
getServerOperationType
in interface ServerProcedureInterface
private void addMissingQueues(MasterProcedureEnv env) throws ReplicationException
ReplicationException
private StateMachineProcedure.Flow claimQueues(MasterProcedureEnv env) throws ReplicationException, IOException
ReplicationException
IOException
private boolean shouldSkip(MasterProcedureEnv env) throws IOException
IOException
private void removeQueues(MasterProcedureEnv env) throws ReplicationException, IOException
ReplicationException
IOException
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState state) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
state
- state to executeProcedureSuspendedException
ProcedureYieldException
InterruptedException
protected boolean setTimeoutFailure(MasterProcedureEnv env)
Procedure
WAITING_TIMEOUT
by calling setState
method, and throw a
ProcedureSuspendedException
to halt the execution of the procedure, and do not forget a
call Procedure.setTimeout(int)
method to set the timeout. And you should also override this
method to wake up the procedure, and also return false to tell the ProcedureExecutor that the
timeout event has been handled.setTimeoutFailure
in class Procedure<MasterProcedureEnv>
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState state) throws IOException, InterruptedException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
state
- state to rollbackIOException
- temporary failure, the rollback will retry laterInterruptedException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
state
- the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.AssignReplicationQueuesState>
serializer
- contains the serialized stateIOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.