@InterfaceAudience.Private public class MoveRegionProcedure extends AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>
Throws exception on construction if determines context hostile to move (cluster going down or master is shutting down or table is disabled).
StateMachineProcedure.FlowProcedure.LockStateTableProcedureInterface.TableOperationTypestateCountNO_PROC_ID, NO_TIMEOUT| Constructor and Description |
|---|
MoveRegionProcedure() |
MoveRegionProcedure(MasterProcedureEnv env,
RegionPlan plan,
boolean check) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abort(MasterProcedureEnv env)
The abort() call is asynchronous and each procedure must decide how to deal
with it, if they want to be abortable.
|
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,
MasterProcedureProtos.MoveRegionState state)
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.MoveRegionState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected RegionPlan |
getPlan() |
protected MasterProcedureProtos.MoveRegionState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.MoveRegionState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
TableName |
getTableName() |
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
protected void |
rollbackState(MasterProcedureEnv env,
MasterProcedureProtos.MoveRegionState 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 |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
acquireLock, checkTableModifiable, getRegion, holdLock, releaseLock, setFailure, setRegioncheckOnline, getUser, getWALRegionDir, preflightChecks, releaseSyncLatch, setUser, waitInitializedaddChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isRollbackSupported, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateaddStackIndex, 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, 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, wasExecutedpublic MoveRegionProcedure()
public MoveRegionProcedure(MasterProcedureEnv env, RegionPlan plan, boolean check) throws HBaseIOException
check - whether we should do some checks in the constructor. We will skip the checks if we
are reopening a region as this may fail the whole procedure and cause stuck. We will
do the check later when actually executing the procedure so not a big problem.IOException - If the cluster is offline or master is stopping or if table is disabled or
non-existent.HBaseIOExceptionprotected RegionPlan getPlan()
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.MoveRegionState state) throws InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>state - state to executeInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.MoveRegionState state) throws IOException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>state - state to rollbackIOException - temporary failure, the rollback will retry laterpublic boolean abort(MasterProcedureEnv env)
ProcedureNOTE: abort() is not like Thread.interrupt(). It is just a notification that allows the procedure implementor abort.
abort in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>public void toStringClassDetails(StringBuilder sb)
ProceduretoStringClassDetails in class AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>sb - the string builder to use to append the proc specific informationprotected MasterProcedureProtos.MoveRegionState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>protected int getStateId(MasterProcedureProtos.MoveRegionState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>state - the state enum objectprotected MasterProcedureProtos.MoveRegionState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.MoveRegionState>stateId - the ordinal() of the state enum (or state id)public TableName getTableName()
getTableName in interface TableProcedureInterfacegetTableName in class AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfacegetTableOperationType in class AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
ProcedureserializeStateData in class AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>serializer - stores the serializable stateIOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
ProceduredeserializeStateData in class AbstractStateMachineRegionProcedure<MasterProcedureProtos.MoveRegionState>serializer - contains the serialized stateIOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.