@InterfaceAudience.Private public class DeleteNamespaceProcedure extends AbstractStateMachineNamespaceProcedure<MasterProcedureProtos.DeleteNamespaceState>
StateMachineProcedure.FlowProcedure.LockStateTableProcedureInterface.TableOperationTypestateCountNO_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,
MasterProcedureProtos.DeleteNamespaceState state)
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.DeleteNamespaceState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected String |
getNamespaceName() |
protected MasterProcedureProtos.DeleteNamespaceState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.DeleteNamespaceState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
protected boolean |
isRollbackSupported(MasterProcedureProtos.DeleteNamespaceState state)
Used by the default implementation of abort() to know if the current state can be aborted
and rollback can be triggered.
|
protected static void |
removeFromZKNamespaceManager(MasterProcedureEnv env,
String namespaceName)
remove from ZooKeeper.
|
protected static void |
removeNamespaceQuota(MasterProcedureEnv env,
String namespaceName)
remove quota for the namespace
|
protected void |
rollbackState(MasterProcedureEnv env,
MasterProcedureProtos.DeleteNamespaceState 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, getTableName, releaseLock, releaseSyncLatch, toStringClassDetails, waitInitializedabort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, 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, 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, wasExecutedpublic DeleteNamespaceProcedure()
public DeleteNamespaceProcedure(MasterProcedureEnv env, String namespaceName)
public DeleteNamespaceProcedure(MasterProcedureEnv env, String namespaceName, ProcedurePrepareLatch latch)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.DeleteNamespaceState state) throws InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>state - state to executeInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.DeleteNamespaceState state) throws IOException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>state - state to rollbackIOException - temporary failure, the rollback will retry laterprotected boolean isRollbackSupported(MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProcedureprotected MasterProcedureProtos.DeleteNamespaceState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>state - the state enum objectprotected MasterProcedureProtos.DeleteNamespaceState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>serializer - stores the serializable stateIOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.DeleteNamespaceState>serializer - contains the serialized stateIOExceptionpublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfacegetTableOperationType in class AbstractStateMachineNamespaceProcedure<MasterProcedureProtos.DeleteNamespaceState>protected String getNamespaceName()
getNamespaceName in class AbstractStateMachineNamespaceProcedure<MasterProcedureProtos.DeleteNamespaceState>protected static void deleteFromNSTable(MasterProcedureEnv env, String namespaceName) throws IOException
env - MasterProcedureEnvnamespaceName - name of the namespace in string formatIOExceptionprotected static void removeFromZKNamespaceManager(MasterProcedureEnv env, String namespaceName) throws IOException
env - MasterProcedureEnvnamespaceName - name of the namespace in string formatIOExceptionprotected static void deleteDirectory(MasterProcedureEnv env, String namespaceName) throws IOException
env - MasterProcedureEnvnamespaceName - name of the namespace in string formatIOExceptionprotected static void removeNamespaceQuota(MasterProcedureEnv env, String namespaceName) throws IOException
env - MasterProcedureEnvnamespaceName - name of the namespace in string formatIOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.