@InterfaceAudience.Private public class SplitWALProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState> implements ServerProcedureInterface
SplitWALRemoteProcedure to actually send the request to region
server to split this WAL.
It also check if the split wal task really succeed. If the WAL still exists, it will
schedule another region server to split this WAL.StateMachineProcedure.FlowProcedure.LockStateServerProcedureInterface.ServerOperationType| Modifier and Type | Field and Description |
|---|---|
private ServerName |
crashedServer |
private static org.slf4j.Logger |
LOG |
private RetryCounter |
retryCounter |
private String |
walPath |
private ServerName |
worker |
NO_PROC_ID, NO_TIMEOUT| Constructor and Description |
|---|
SplitWALProcedure() |
SplitWALProcedure(String walPath,
ServerName crashedServer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterReplay(MasterProcedureEnv env)
Called when the procedure is ready to be added to the queue after
the loading/replay operation.
|
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.SplitWALState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState |
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.SplitWALState |
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.SplitWALState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
String |
getWAL() |
ServerName |
getWorker() |
boolean |
hasMetaTableRegion() |
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState splitOneWalState)
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.
|
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateacquireLock, addStackIndex, 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, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecutedprivate static final org.slf4j.Logger LOG
private ServerName worker
private ServerName crashedServer
private RetryCounter retryCounter
public SplitWALProcedure()
public SplitWALProcedure(String walPath, ServerName crashedServer)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState state) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>state - state to executeProcedureSuspendedExceptionProcedureYieldExceptionInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState splitOneWalState) throws IOException, InterruptedException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>splitOneWalState - state to rollbackIOException - temporary failure, the rollback will retry laterInterruptedExceptionprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>state - the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>serializer - stores the serializable stateIOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>serializer - contains the serialized stateIOExceptionprotected boolean setTimeoutFailure(MasterProcedureEnv env)
ProcedureWAITING_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>public ServerName getWorker()
public ServerName getServerName()
getServerName in interface ServerProcedureInterfacepublic boolean hasMetaTableRegion()
hasMetaTableRegion in interface ServerProcedureInterfacepublic ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterfacegetServerOperationType in interface ServerProcedureInterfaceprotected void afterReplay(MasterProcedureEnv env)
ProcedureafterReplay in class Procedure<MasterProcedureEnv>Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.