@InterfaceAudience.Private public class DeleteNamespaceProcedure extends StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState> implements TableProcedureInterface
StateMachineProcedure.FlowTableProcedureInterface.TableOperationType| Constructor and Description |
|---|
DeleteNamespaceProcedure() |
DeleteNamespaceProcedure(MasterProcedureEnv env,
String namespaceName) |
| 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.
|
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
|
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.DeleteNamespaceState state)
called to perform a single step of the specified 'state' of the procedure
|
protected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected org.apache.hadoop.hbase.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.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState 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 void |
releaseLock(MasterProcedureEnv env)
The user should override this method, and release lock if necessary.
|
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,
org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState 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(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
Set the next state for the procedure.
|
void |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
addChildProcedure, execute, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, 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, hasChildren, hasException, hasOwner, hasParent, hasTimeout, incChildrenLatch, isFailed, isFinished, isRunnable, 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, wasExecutedpublic DeleteNamespaceProcedure()
public DeleteNamespaceProcedure(MasterProcedureEnv env, String namespaceName)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state) throws InterruptedException
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>state - state to executeInterruptedExceptionprotected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state) throws IOException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>state - state to rollbackIOException - temporary failure, the rollback will retry laterprotected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>state - the state enum objectprotected org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>protected void setNextState(org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState state)
StateMachineProceduresetNextState in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>state - the state enum objectpublic boolean abort(MasterProcedureEnv env)
Procedureabort in class Procedure<MasterProcedureEnv>public void serializeStateData(OutputStream stream) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.protobuf.generated.MasterProcedureProtos.DeleteNamespaceState>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.DeleteNamespaceState>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 informationprotected boolean acquireLock(MasterProcedureEnv env)
ProcedureacquireLock in class Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
ProcedurereleaseLock in class Procedure<MasterProcedureEnv>public TableName getTableName()
getTableName in interface TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfaceprotected 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 The Apache Software Foundation. All rights reserved.