@InterfaceAudience.Private public class DeleteNamespaceProcedure extends AbstractStateMachineNamespaceProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
StateMachineProcedure.Flow
Procedure.LockState
TableProcedureInterface.TableOperationType
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private String |
namespaceName |
private NamespaceDescriptor |
nsDescriptor |
private Boolean |
traceEnabled |
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
DeleteNamespaceProcedure() |
DeleteNamespaceProcedure(MasterProcedureEnv env,
String namespaceName) |
DeleteNamespaceProcedure(MasterProcedureEnv env,
String namespaceName,
ProcedurePrepareLatch latch) |
Modifier and Type | Method and Description |
---|---|
protected static void |
deleteDirectory(MasterProcedureEnv env,
String namespaceName)
Delete the namespace directories from the file system
|
protected static void |
deleteFromNSTable(MasterProcedureEnv env,
String namespaceName)
delete the row from namespace table
|
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.DeleteNamespaceState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected String |
getNamespaceName() |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState |
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.DeleteNamespaceState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
private static TableNamespaceManager |
getTableNamespaceManager(MasterProcedureEnv env) |
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
protected boolean |
isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
Used by the default implementation of abort() to know if the current state can be aborted
and rollback can be triggered.
|
private Boolean |
isTraceEnabled()
The procedure could be restarted from a different machine.
|
private boolean |
prepareDelete(MasterProcedureEnv env)
Action before any real action of deleting namespace.
|
protected static void |
removeFromZKNamespaceManager(MasterProcedureEnv env,
String namespaceName)
remove from ZooKeeper.
|
protected static void |
removeNamespaceQuota(MasterProcedureEnv env,
String namespaceName)
remove quota for the namespace
|
private void |
rollbackDeleteDirectory(MasterProcedureEnv env)
undo delete directory
|
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
called to perform the rollback of the specified state
|
private void |
rollbacRemoveNamespaceQuota(MasterProcedureEnv env)
undo remove quota for the namespace
|
protected void |
serializeStateData(ProcedureStateSerializer serializer)
The user-level code of the procedure may have some state to
persist (e.g.
|
private void |
undoDeleteFromNSTable(MasterProcedureEnv env)
undo the delete
|
private void |
undoRemoveFromZKNamespaceManager(MasterProcedureEnv env)
undo the remove from ZooKeeper
|
acquireLock, getTableName, releaseLock, releaseSyncLatch, toStringClassDetails, waitInitialized
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, 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, 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, wasExecuted
private static final org.slf4j.Logger LOG
private NamespaceDescriptor nsDescriptor
private String namespaceName
private Boolean traceEnabled
public DeleteNamespaceProcedure()
public DeleteNamespaceProcedure(MasterProcedureEnv env, String namespaceName)
public DeleteNamespaceProcedure(MasterProcedureEnv env, String namespaceName, ProcedurePrepareLatch latch)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state) throws InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
state
- state to executeInterruptedException
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state) throws IOException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
state
- state to rollbackIOException
- temporary failure, the rollback will retry laterprotected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProcedure
isRollbackSupported
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
state
- the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
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.DeleteNamespaceState>
serializer
- contains the serialized stateIOException
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
getTableOperationType
in interface TableProcedureInterface
getTableOperationType
in class AbstractStateMachineNamespaceProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
protected String getNamespaceName()
getNamespaceName
in class AbstractStateMachineNamespaceProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>
private boolean prepareDelete(MasterProcedureEnv env) throws IOException
env
- MasterProcedureEnvIOException
protected static void deleteFromNSTable(MasterProcedureEnv env, String namespaceName) throws IOException
env
- MasterProcedureEnvnamespaceName
- name of the namespace in string formatIOException
private void undoDeleteFromNSTable(MasterProcedureEnv env)
env
- MasterProcedureEnvIOException
protected static void removeFromZKNamespaceManager(MasterProcedureEnv env, String namespaceName) throws IOException
env
- MasterProcedureEnvnamespaceName
- name of the namespace in string formatIOException
private void undoRemoveFromZKNamespaceManager(MasterProcedureEnv env)
env
- MasterProcedureEnvIOException
protected static void deleteDirectory(MasterProcedureEnv env, String namespaceName) throws IOException
env
- MasterProcedureEnvnamespaceName
- name of the namespace in string formatIOException
private void rollbackDeleteDirectory(MasterProcedureEnv env) throws IOException
env
- MasterProcedureEnvIOException
protected static void removeNamespaceQuota(MasterProcedureEnv env, String namespaceName) throws IOException
env
- MasterProcedureEnvnamespaceName
- name of the namespace in string formatIOException
private void rollbacRemoveNamespaceQuota(MasterProcedureEnv env) throws IOException
env
- MasterProcedureEnvIOException
private static TableNamespaceManager getTableNamespaceManager(MasterProcedureEnv env)
private Boolean isTraceEnabled()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.