@InterfaceAudience.Private public class DisableTableProcedure extends StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState> implements TableProcedureInterface
StateMachineProcedure.FlowTableProcedureInterface.TableOperationType| Constructor and Description | 
|---|
DisableTableProcedure()  | 
DisableTableProcedure(MasterProcedureEnv env,
                     TableName tableName,
                     boolean skipTableStateCheck)
Constructor 
 | 
DisableTableProcedure(MasterProcedureEnv env,
                     TableName tableName,
                     boolean skipTableStateCheck,
                     ProcedurePrepareLatch syncLatch)
Constructor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
abort(MasterProcedureEnv env)
The abort() call is asynchronous and each procedure must decide how to deal
 with that, if they want to be abortable. 
 | 
protected boolean | 
acquireLock(MasterProcedureEnv env)
The user should override this method, and try to take a lock if necessary. 
 | 
void | 
deserializeStateData(InputStream stream)
Called on store load to allow the user to decode the previously serialized
 state. 
 | 
protected StateMachineProcedure.Flow | 
executeFromState(MasterProcedureEnv env,
                MasterProcedureProtos.DisableTableState state)
called to perform a single step of the specified 'state' of the procedure 
 | 
protected MasterProcedureProtos.DisableTableState | 
getInitialState()
Return the initial state object that will be used for the first call to executeFromState(). 
 | 
protected MasterProcedureProtos.DisableTableState | 
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object. 
 | 
protected int | 
getStateId(MasterProcedureProtos.DisableTableState 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 static org.apache.hadoop.hbase.master.procedure.DisableTableProcedure.MarkRegionOfflineOpResult | 
markRegionsOffline(MasterProcedureEnv env,
                  TableName tableName,
                  Boolean retryRequired)
Mark regions of the table offline with retries 
 | 
protected void | 
postDisable(MasterProcedureEnv env,
           MasterProcedureProtos.DisableTableState state)
Action after disabling table. 
 | 
protected void | 
preDisable(MasterProcedureEnv env,
          MasterProcedureProtos.DisableTableState state)
Action before disabling table. 
 | 
protected void | 
releaseLock(MasterProcedureEnv env)
The user should override this method, and release lock if necessary. 
 | 
protected void | 
rollbackState(MasterProcedureEnv env,
             MasterProcedureProtos.DisableTableState state)
called to perform the rollback of the specified state 
 | 
void | 
serializeStateData(OutputStream stream)
The user-level code of the procedure may have some state to
 persist (e.g. 
 | 
protected void | 
setNextState(MasterProcedureProtos.DisableTableState state)
Set the next state for the procedure. 
 | 
protected static void | 
setTableStateToDisabled(MasterProcedureEnv env,
                       TableName tableName)
Mark table state to Disabled 
 | 
protected static void | 
setTableStateToDisabling(MasterProcedureEnv env,
                        TableName tableName)
Mark table state to Disabling 
 | 
void | 
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
 e.g. 
 | 
execute, rollbackaddStackIndex, beforeReplay, childrenCountDown, compareTo, completionCleanup, convert, convert, createProcedureInfo, doExecute, doRollback, elapsedTime, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getResult, getRootProcedureId, getStackIndexes, getStartTime, getState, getTimeout, getTimeRemaining, hasException, hasOwner, hasParent, hasTimeout, incChildrenLatch, isFailed, isFinished, isSuccess, isWaiting, newInstance, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setNonceKey, setOwner, setParentProcId, setProcId, setResult, setStackIndexes, setStartTime, setState, setTimeout, setTimeoutFailure, toString, toStringClass, toStringDetails, toStringSimpleSB, updateTimestamp, validateClass, wasExecutedpublic DisableTableProcedure()
public DisableTableProcedure(MasterProcedureEnv env, TableName tableName, boolean skipTableStateCheck) throws IOException
env - MasterProcedureEnvtableName - the table to operate onskipTableStateCheck - whether to check table stateIOExceptionpublic DisableTableProcedure(MasterProcedureEnv env, TableName tableName, boolean skipTableStateCheck, ProcedurePrepareLatch syncLatch) throws IOException
env - MasterProcedureEnvtableName - the table to operate onskipTableStateCheck - whether to check table stateIOExceptionprotected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.DisableTableState state)
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>state - state to executeprotected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.DisableTableState state) throws IOException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>state - state to rollbackIOException - temporary failure, the rollback will retry laterprotected MasterProcedureProtos.DisableTableState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.DisableTableState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>state - the state enum objectprotected MasterProcedureProtos.DisableTableState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>protected void setNextState(MasterProcedureProtos.DisableTableState state)
StateMachineProceduresetNextState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>state - the state enum objectpublic boolean abort(MasterProcedureEnv env)
Procedureabort in class Procedure<MasterProcedureEnv>env - the environment passed to the ProcedureExecutorprotected boolean acquireLock(MasterProcedureEnv env)
ProcedureacquireLock in class Procedure<MasterProcedureEnv>env - the environment passed to the ProcedureExecutorprotected void releaseLock(MasterProcedureEnv env)
ProcedurereleaseLock in class Procedure<MasterProcedureEnv>env - the environment passed to the ProcedureExecutorpublic void serializeStateData(OutputStream stream) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>stream - the stream that will contain the user serialized dataIOException - failure to stream datapublic void deserializeStateData(InputStream stream) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DisableTableState>stream - the stream that contains the user serialized dataIOExceptionpublic void toStringClassDetails(StringBuilder sb)
ProceduretoStringClassDetails in class Procedure<MasterProcedureEnv>sb - the string builder to use to append the proc specific informationpublic TableName getTableName()
getTableName in interface TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfaceprotected void preDisable(MasterProcedureEnv env, MasterProcedureProtos.DisableTableState state) throws IOException, InterruptedException
env - MasterProcedureEnvstate - the procedure stateIOExceptionInterruptedExceptionprotected static void setTableStateToDisabling(MasterProcedureEnv env, TableName tableName) throws HBaseException, IOException
env - MasterProcedureEnvIOExceptionHBaseExceptionprotected static org.apache.hadoop.hbase.master.procedure.DisableTableProcedure.MarkRegionOfflineOpResult markRegionsOffline(MasterProcedureEnv env, TableName tableName, Boolean retryRequired) throws IOException
env - MasterProcedureEnvtableName - the target tableretryRequired - whether to retry if the first run failedIOExceptionprotected static void setTableStateToDisabled(MasterProcedureEnv env, TableName tableName) throws HBaseException, IOException
env - MasterProcedureEnvIOExceptionHBaseExceptionprotected void postDisable(MasterProcedureEnv env, MasterProcedureProtos.DisableTableState state) throws IOException, InterruptedException
env - MasterProcedureEnvstate - the procedure stateIOExceptionInterruptedException