@InterfaceAudience.Private public class AddColumnFamilyProcedure extends StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState> implements TableProcedureInterface
StateMachineProcedure.Flow
TableProcedureInterface.TableOperationType
Constructor and Description |
---|
AddColumnFamilyProcedure() |
AddColumnFamilyProcedure(MasterProcedureEnv env,
TableName tableName,
HColumnDescriptor cfDescriptor) |
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.
|
void |
deserializeStateData(InputStream stream)
Called on store load to allow the user to decode the previously serialized
state.
|
protected StateMachineProcedure.Flow |
executeFromState(MasterProcedureEnv env,
MasterProcedureProtos.AddColumnFamilyState state)
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.AddColumnFamilyState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected MasterProcedureProtos.AddColumnFamilyState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.AddColumnFamilyState 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 void |
rollbackState(MasterProcedureEnv env,
MasterProcedureProtos.AddColumnFamilyState 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(MasterProcedureProtos.AddColumnFamilyState state)
Set the next state for the procedure.
|
void |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
execute, rollback
addStackIndex, beforeReplay, childrenCountDown, compareTo, completionCleanup, convert, convert, createProcedureInfo, doExecute, doRollback, elapsedTime, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcId, getResult, getRootProcedureId, getStackIndexes, getStartTime, getState, getTimeout, getTimeRemaining, hasException, hasOwner, hasParent, hasTimeout, incChildrenLatch, isFailed, isFinished, isSuccess, isWaiting, newInstance, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setNonceKey, setOwner, setParentProcId, setProcId, setResult, setStackIndexes, setStartTime, setState, setTimeout, setTimeoutFailure, toString, toStringClass, toStringDetails, toStringSimpleSB, updateTimestamp, validateClass, wasExecuted
public AddColumnFamilyProcedure()
public AddColumnFamilyProcedure(MasterProcedureEnv env, TableName tableName, HColumnDescriptor cfDescriptor)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.AddColumnFamilyState state)
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
state
- state to executeprotected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.AddColumnFamilyState state) throws IOException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
state
- state to rollbackIOException
- temporary failure, the rollback will retry laterprotected MasterProcedureProtos.AddColumnFamilyState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.AddColumnFamilyState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
state
- the state enum objectprotected MasterProcedureProtos.AddColumnFamilyState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
protected void setNextState(MasterProcedureProtos.AddColumnFamilyState state)
StateMachineProcedure
setNextState
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
state
- the state enum objectpublic boolean abort(MasterProcedureEnv env)
Procedure
abort
in class Procedure<MasterProcedureEnv>
protected boolean acquireLock(MasterProcedureEnv env)
Procedure
acquireLock
in class Procedure<MasterProcedureEnv>
protected void releaseLock(MasterProcedureEnv env)
Procedure
releaseLock
in class Procedure<MasterProcedureEnv>
public void serializeStateData(OutputStream stream) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
stream
- the stream that will contain the user serialized dataIOException
public void deserializeStateData(InputStream stream) throws IOException
Procedure
deserializeStateData
in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.AddColumnFamilyState>
stream
- the stream that contains the user serialized dataIOException
public void toStringClassDetails(StringBuilder sb)
Procedure
toStringClassDetails
in class Procedure<MasterProcedureEnv>
sb
- the string builder to use to append the proc specific informationpublic TableName getTableName()
getTableName
in interface TableProcedureInterface
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
getTableOperationType
in interface TableProcedureInterface
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.