@InterfaceAudience.Private public class SwitchRpcThrottleProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState> implements ServerProcedureInterface
StateMachineProcedure.FlowProcedure.LockStateServerProcedureInterface.ServerOperationType| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG |
private RetryCounter |
retryCounter |
private boolean |
rpcThrottleEnabled |
private RpcThrottleStorage |
rpcThrottleStorage |
private ServerName |
serverName |
private ProcedurePrepareLatch |
syncLatch |
stateCountNO_PROC_ID, NO_TIMEOUT| Constructor and Description |
|---|
SwitchRpcThrottleProcedure() |
SwitchRpcThrottleProcedure(RpcThrottleStorage rpcThrottleStorage,
boolean rpcThrottleEnabled,
ServerName serverName,
ProcedurePrepareLatch syncLatch) |
| Modifier and Type | Method and Description |
|---|---|
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.SwitchRpcThrottleState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState |
getCurrentState() |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
ServerName |
getServerName() |
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.SwitchRpcThrottleState |
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.SwitchRpcThrottleState throttleState)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
boolean |
hasMetaTableRegion() |
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState 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.
|
void |
switchThrottleState(MasterProcedureEnv env,
boolean rpcThrottleEnabled) |
void |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
abort, addChildProcedure, execute, failIfAborted, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateacquireLock, 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, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecutedprivate static org.slf4j.Logger LOG
private RpcThrottleStorage rpcThrottleStorage
private boolean rpcThrottleEnabled
private ProcedurePrepareLatch syncLatch
private ServerName serverName
private RetryCounter retryCounter
public SwitchRpcThrottleProcedure()
public SwitchRpcThrottleProcedure(RpcThrottleStorage rpcThrottleStorage, boolean rpcThrottleEnabled, ServerName serverName, ProcedurePrepareLatch syncLatch)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState state) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>state - state to executeProcedureSuspendedExceptionProcedureYieldExceptionInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState state) throws IOException, InterruptedException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>state - state to rollbackIOException - temporary failure, the rollback will retry laterInterruptedExceptionprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState throttleState)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>throttleState - the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState getCurrentState()
getCurrentState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>serializer - stores the serializable stateIOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SwitchRpcThrottleState>serializer - contains the serialized stateIOExceptionpublic ServerName getServerName()
getServerName in interface ServerProcedureInterfacepublic boolean hasMetaTableRegion()
hasMetaTableRegion in interface ServerProcedureInterfacepublic ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterfacegetServerOperationType in interface ServerProcedureInterfacepublic void switchThrottleState(MasterProcedureEnv env, boolean rpcThrottleEnabled) throws IOException
IOExceptionpublic void toStringClassDetails(StringBuilder sb)
ProceduretoStringClassDetails in class Procedure<MasterProcedureEnv>sb - the string builder to use to append the proc specific informationCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.