@InterfaceAudience.Private public class DeleteTableProcedure extends AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
StateMachineProcedure.Flow
Procedure.LockState
TableProcedureInterface.TableOperationType
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private List<RegionInfo> |
regions |
private TableName |
tableName |
stateCount
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
DeleteTableProcedure() |
DeleteTableProcedure(MasterProcedureEnv env,
TableName tableName) |
DeleteTableProcedure(MasterProcedureEnv env,
TableName tableName,
ProcedurePrepareLatch syncLatch) |
Modifier and Type | Method and Description |
---|---|
protected 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.
|
private static void |
cleanRegionsInMeta(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<RegionInfo> regions,
boolean archive) |
protected static void |
deleteFromMeta(MasterProcedureEnv env,
TableName tableName,
List<RegionInfo> regions) |
protected static void |
deleteTableDescriptorCache(MasterProcedureEnv env,
TableName tableName) |
protected static void |
deleteTableStates(MasterProcedureEnv env,
TableName tableName) |
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.DeleteTableState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.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.shaded.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.shaded.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.
|
protected boolean |
holdLock(MasterProcedureEnv env)
Used to keep the procedure lock even when the procedure is yielding or suspended.
|
protected boolean |
isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
Used by the default implementation of abort() to know if the current state can be aborted
and rollback can be triggered.
|
private void |
postDelete(MasterProcedureEnv env) |
private boolean |
preDelete(MasterProcedureEnv env) |
private boolean |
prepareDelete(MasterProcedureEnv env) |
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState 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.
|
acquireLock, checkOnline, checkTableModifiable, getUser, getWALRegionDir, preflightChecks, releaseLock, releaseSyncLatch, setUser, toStringClassDetails, waitInitialized
addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
addStackIndex, 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, wasExecuted
private static final org.slf4j.Logger LOG
private List<RegionInfo> regions
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.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState state) throws InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
state
- state to executeInterruptedException
protected boolean abort(MasterProcedureEnv env)
Procedure
NOTE: abort() is not like Thread.interrupt(). It is just a notification that allows the procedure implementor abort.
abort
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
state
- state to rollbackprotected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
StateMachineProcedure
isRollbackSupported
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
state
- the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
protected boolean holdLock(MasterProcedureEnv env)
Procedure
holdLock
in class Procedure<MasterProcedureEnv>
public TableName getTableName()
getTableName
in interface TableProcedureInterface
getTableName
in class AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
getTableOperationType
in interface TableProcedureInterface
getTableOperationType
in class AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteTableState>
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.DeleteTableState>
serializer
- contains the serialized stateIOException
private boolean prepareDelete(MasterProcedureEnv env) throws IOException
IOException
private boolean preDelete(MasterProcedureEnv env) throws IOException, InterruptedException
IOException
InterruptedException
private void postDelete(MasterProcedureEnv env) throws IOException, InterruptedException
IOException
InterruptedException
protected static void deleteFromFs(MasterProcedureEnv env, TableName tableName, List<RegionInfo> regions, boolean archive) throws IOException
IOException
private static void cleanRegionsInMeta(MasterProcedureEnv env, TableName tableName) throws IOException
IOException
protected static void deleteFromMeta(MasterProcedureEnv env, TableName tableName, List<RegionInfo> regions) throws IOException
IOException
protected static void deleteAssignmentState(MasterProcedureEnv env, TableName tableName) throws IOException
IOException
protected static void deleteTableDescriptorCache(MasterProcedureEnv env, TableName tableName) throws IOException
IOException
protected static void deleteTableStates(MasterProcedureEnv env, TableName tableName) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.