ServerCrashProcedure
directly, and the initial work for meta table
will be done by InitMetaProcedure
.@Deprecated @InterfaceAudience.Private public class RecoverMetaProcedure extends StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState> implements MetaProcedureInterface
ServerCrashProcedure
,
InitMetaProcedure
StateMachineProcedure.Flow
Procedure.LockState
MetaProcedureInterface.MetaOperationType
stateCount
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
RecoverMetaProcedure()
Deprecated.
This constructor is also used when deserializing from a procedure store; we'll construct one
of these then call #deserializeStateData(InputStream).
|
RecoverMetaProcedure(ServerName failedMetaServer,
boolean shouldSplitLog)
Deprecated.
Call this constructor to queue up a
RecoverMetaProcedure in response to meta
carrying server crash |
RecoverMetaProcedure(ServerName failedMetaServer,
boolean shouldSplitLog,
ProcedurePrepareLatch latch)
Deprecated.
Constructor with latch, for blocking/ sync usage
|
Modifier and Type | Method and Description |
---|---|
protected Procedure.LockState |
acquireLock(MasterProcedureEnv env)
Deprecated.
The user should override this method if they need a lock on an Entity.
|
protected void |
completionCleanup(MasterProcedureEnv env)
Deprecated.
Called when the procedure is marked as completed (success or rollback).
|
protected void |
deserializeStateData(ProcedureStateSerializer serializer)
Deprecated.
Called on store load to allow the user to decode the previously serialized
state.
|
protected StateMachineProcedure.Flow |
executeFromState(MasterProcedureEnv env,
MasterProcedureProtos.RecoverMetaState state)
Deprecated.
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.RecoverMetaState |
getInitialState()
Deprecated.
Return the initial state object that will be used for the first call to executeFromState().
|
protected MasterProcedureProtos.RecoverMetaState |
getState(int stateId)
Deprecated.
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.RecoverMetaState recoverMetaState)
Deprecated.
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
protected void |
releaseLock(MasterProcedureEnv env)
Deprecated.
The user should override this method, and release lock if necessary.
|
protected void |
rollbackState(MasterProcedureEnv env,
MasterProcedureProtos.RecoverMetaState recoverMetaState)
Deprecated.
called to perform the rollback of the specified state
|
protected void |
serializeStateData(ProcedureStateSerializer serializer)
Deprecated.
The user-level code of the procedure may have some state to
persist (e.g.
|
protected void |
toStringClassDetails(StringBuilder sb)
Deprecated.
Extend the toString() information with the procedure details
e.g.
|
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
addStackIndex, afterReplay, beforeReplay, bypass, compareTo, 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, 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, wasExecuted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMetaOperationType
public RecoverMetaProcedure(ServerName failedMetaServer, boolean shouldSplitLog)
RecoverMetaProcedure
in response to meta
carrying server crashfailedMetaServer
- failed/ crashed region server that was carrying metashouldSplitLog
- split log file of meta regionpublic RecoverMetaProcedure(ServerName failedMetaServer, boolean shouldSplitLog, ProcedurePrepareLatch latch)
public RecoverMetaProcedure()
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.RecoverMetaState state) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
state
- state to executeProcedureSuspendedException
ProcedureYieldException
InterruptedException
protected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.RecoverMetaState recoverMetaState) throws IOException, InterruptedException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
recoverMetaState
- state to rollbackIOException
- temporary failure, the rollback will retry laterInterruptedException
protected MasterProcedureProtos.RecoverMetaState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.RecoverMetaState recoverMetaState)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
recoverMetaState
- the state enum objectprotected MasterProcedureProtos.RecoverMetaState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
protected void toStringClassDetails(StringBuilder sb)
Procedure
toStringClassDetails
in class Procedure<MasterProcedureEnv>
sb
- the string builder to use to append the proc specific informationprotected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.RecoverMetaState>
serializer
- contains the serialized stateIOException
protected Procedure.LockState acquireLock(MasterProcedureEnv env)
Procedure
Procedure.execute(Object)
. It calls Procedure.releaseLock(Object)
after the call to
execute.
If you need to hold the lock for the life of the Procedure -- i.e. you do not want any other
Procedure interfering while this Procedure is running, see Procedure.holdLock(Object)
.
Example: in our Master we can execute request in parallel for different tables. We can create
t1 and create t2 and these creates can be executed at the same time. Anything else on t1/t2 is
queued waiting that specific table create to happen.
There are 3 LockState:
acquireLock
in class Procedure<MasterProcedureEnv>
protected void releaseLock(MasterProcedureEnv env)
Procedure
releaseLock
in class Procedure<MasterProcedureEnv>
protected void completionCleanup(MasterProcedureEnv env)
Procedure
completionCleanup
in class Procedure<MasterProcedureEnv>
Copyright © 2007–2019 Cloudera. All rights reserved.