@InterfaceAudience.Private public class ModifyTableProcedure extends AbstractStateMachineTableProcedure<MasterProcedureProtos.ModifyTableState>
StateMachineProcedure.Flow
Procedure.LockState
TableProcedureInterface.TableOperationType
stateCount
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
ModifyTableProcedure() |
ModifyTableProcedure(MasterProcedureEnv env,
TableDescriptor htd) |
ModifyTableProcedure(MasterProcedureEnv env,
TableDescriptor htd,
ProcedurePrepareLatch latch) |
Modifier and Type | Method and Description |
---|---|
protected void |
completionCleanup(MasterProcedureEnv env)
Called when the procedure is marked as completed (success or rollback).
|
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.ModifyTableState state)
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.ModifyTableState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected MasterProcedureProtos.ModifyTableState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.ModifyTableState 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 |
isRollbackSupported(MasterProcedureProtos.ModifyTableState state)
Used by the default implementation of abort() to know if the current state can be aborted
and rollback can be triggered.
|
protected void |
rollbackState(MasterProcedureEnv env,
MasterProcedureProtos.ModifyTableState 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
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
addStackIndex, afterReplay, beforeReplay, bypass, compareTo, 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
public ModifyTableProcedure()
public ModifyTableProcedure(MasterProcedureEnv env, TableDescriptor htd) throws HBaseIOException
HBaseIOException
public ModifyTableProcedure(MasterProcedureEnv env, TableDescriptor htd, ProcedurePrepareLatch latch) throws HBaseIOException
HBaseIOException
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.ModifyTableState state) throws InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
state
- state to executeInterruptedException
protected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.ModifyTableState state) throws IOException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
state
- state to rollbackIOException
- temporary failure, the rollback will retry laterprotected boolean isRollbackSupported(MasterProcedureProtos.ModifyTableState state)
StateMachineProcedure
isRollbackSupported
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
protected void completionCleanup(MasterProcedureEnv env)
Procedure
completionCleanup
in class Procedure<MasterProcedureEnv>
protected MasterProcedureProtos.ModifyTableState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.ModifyTableState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
state
- the state enum objectprotected MasterProcedureProtos.ModifyTableState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.ModifyTableState>
serializer
- contains the serialized stateIOException
public TableName getTableName()
getTableName
in interface TableProcedureInterface
getTableName
in class AbstractStateMachineTableProcedure<MasterProcedureProtos.ModifyTableState>
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
getTableOperationType
in interface TableProcedureInterface
getTableOperationType
in class AbstractStateMachineTableProcedure<MasterProcedureProtos.ModifyTableState>
Copyright © 2007–2019 Cloudera. All rights reserved.