@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.Flow
Procedure.LockState
ServerProcedureInterface.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 |
stateCount
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().
|
String |
getProcName() |
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.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() |
(package private) static String |
getWALNameFromStrPath(String path) |
ServerName |
getWorker() |
boolean |
hasMetaTableRegion()
Returns True if this server has an hbase:meta table region.
|
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.
|
protected void |
toStringClassDetails(StringBuilder builder)
Extend the toString() information with the procedure details e.g.
|
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
acquireLock, addStackIndex, beforeReplay, bypass, compareTo, completionCleanup, doExecute, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcedureMetrics, getProcId, getProcIdHashCode, 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, toStringDetails, toStringSimpleSB, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
private 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
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>
state
- state to executeProcedureSuspendedException
ProcedureYieldException
InterruptedException
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState splitOneWalState) throws IOException, InterruptedException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>
splitOneWalState
- state to rollbackIOException
- temporary failure, the rollback will retry laterInterruptedException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState getState(int stateId)
StateMachineProcedure
getState
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)
StateMachineProcedure
getStateId
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()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.SplitWALState>
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.SplitWALState>
serializer
- contains the serialized stateIOException
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>
public ServerName getWorker()
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
protected void afterReplay(MasterProcedureEnv env)
Procedure
afterReplay
in class Procedure<MasterProcedureEnv>
protected void toStringClassDetails(StringBuilder builder)
Procedure
toStringClassDetails
in class Procedure<MasterProcedureEnv>
builder
- the string builder to use to append the proc specific informationpublic String getProcName()
getProcName
in class Procedure<MasterProcedureEnv>
static String getWALNameFromStrPath(String path)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.