@InterfaceAudience.Private public class DeleteTableProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState> implements TableProcedureInterface
StateMachineProcedure.FlowTableProcedureInterface.TableOperationType| Modifier and Type | Field and Description |
|---|---|
private static org.apache.commons.logging.Log |
LOG |
private List<HRegionInfo> |
regions |
private ProcedurePrepareLatch |
syncLatch |
private TableName |
tableName |
private org.apache.hadoop.security.UserGroupInformation |
user |
| Constructor and Description |
|---|
DeleteTableProcedure() |
DeleteTableProcedure(MasterProcedureEnv env,
TableName tableName) |
DeleteTableProcedure(MasterProcedureEnv env,
TableName tableName,
ProcedurePrepareLatch syncLatch) |
| 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.
|
private static void |
cleanAnyRemainingRows(MasterProcedureEnv env,
TableName tableName)
There may be items for this table still up in hbase:meta in the case where the
info:regioninfo column was empty because of some write error.
|
protected static void |
deleteAssignmentState(MasterProcedureEnv env,
TableName tableName) |
protected static void |
deleteFromFs(MasterProcedureEnv env,
TableName tableName,
List<HRegionInfo> regions,
boolean archive) |
protected static void |
deleteFromMeta(MasterProcedureEnv env,
TableName tableName,
List<HRegionInfo> regions) |
protected static void |
deleteTableDescriptorCache(MasterProcedureEnv env,
TableName tableName) |
protected static void |
deleteTableStates(MasterProcedureEnv env,
TableName tableName) |
void |
deserializeStateData(InputStream stream)
Called on store load to allow the user to decode the previously serialized
state.
|
protected StateMachineProcedure.Flow |
executeFromState(MasterProcedureEnv env,
org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState 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.
|
private void |
postDelete(MasterProcedureEnv env) |
private boolean |
preDelete(MasterProcedureEnv env) |
private boolean |
prepareDelete(MasterProcedureEnv env) |
protected void |
releaseLock(MasterProcedureEnv env)
The user should override this method, and release lock if necessary.
|
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState 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.
|
void |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
execute, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringStateaddStackIndex, beforeReplay, childrenCountDown, compareTo, completionCleanup, convert, convert, createProcedureInfo, doExecute, doRollback, elapsedTime, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getProcIdHashCode, 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, shouldWaitClientAck, toString, toStringClass, toStringDetails, toStringSimpleSB, updateTimestamp, validateClass, wasExecutedprivate static final org.apache.commons.logging.Log LOG
private List<HRegionInfo> regions
private org.apache.hadoop.security.UserGroupInformation user
private TableName tableName
private final ProcedurePrepareLatch syncLatch
public DeleteTableProcedure()
public DeleteTableProcedure(MasterProcedureEnv env, TableName tableName)
public DeleteTableProcedure(MasterProcedureEnv env, TableName tableName, ProcedurePrepareLatch syncLatch)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState state) throws InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>state - state to executeInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>state - state to rollbackprotected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>state - the state enum objectprotected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>public TableName getTableName()
getTableName in interface TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfacepublic boolean abort(MasterProcedureEnv env)
Procedureabort in class Procedure<MasterProcedureEnv>protected boolean acquireLock(MasterProcedureEnv env)
ProcedureacquireLock in class Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
ProcedurereleaseLock in class Procedure<MasterProcedureEnv>public void toStringClassDetails(StringBuilder sb)
ProceduretoStringClassDetails in class Procedure<MasterProcedureEnv>sb - the string builder to use to append the proc specific informationpublic void serializeStateData(OutputStream stream) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>stream - the stream that will contain the user serialized dataIOExceptionpublic void deserializeStateData(InputStream stream) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteTableState>stream - the stream that contains the user serialized dataIOExceptionprivate boolean prepareDelete(MasterProcedureEnv env) throws IOException
IOExceptionprivate boolean preDelete(MasterProcedureEnv env) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprivate void postDelete(MasterProcedureEnv env) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected static void deleteFromFs(MasterProcedureEnv env, TableName tableName, List<HRegionInfo> regions, boolean archive) throws IOException
IOExceptionprivate static void cleanAnyRemainingRows(MasterProcedureEnv env, TableName tableName) throws IOException
IOExceptionprotected static void deleteFromMeta(MasterProcedureEnv env, TableName tableName, List<HRegionInfo> regions) throws IOException
IOExceptionprotected static void deleteAssignmentState(MasterProcedureEnv env, TableName tableName) throws HBaseException, IOException
HBaseExceptionIOExceptionprotected static void deleteTableDescriptorCache(MasterProcedureEnv env, TableName tableName) throws IOException
IOExceptionprotected static void deleteTableStates(MasterProcedureEnv env, TableName tableName) throws IOException
IOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.