@InterfaceAudience.Private public class CreateTableProcedure extends StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState> implements TableProcedureInterface
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
CreateTableProcedure.CreateHdfsRegions |
StateMachineProcedure.FlowTableProcedureInterface.TableOperationType| Constructor and Description |
|---|
CreateTableProcedure() |
CreateTableProcedure(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
HRegionInfo[] newRegions) |
CreateTableProcedure(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
HRegionInfo[] newRegions,
ProcedurePrepareLatch syncLatch) |
| 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 |
addRegionsToMeta(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
List<HRegionInfo> regionInfos)
Add the specified set of regions to the hbase:meta table.
|
protected static List<HRegionInfo> |
addTableToMeta(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
List<HRegionInfo> regions) |
protected static void |
assignRegions(MasterProcedureEnv env,
TableName tableName,
List<HRegionInfo> regions) |
protected static List<HRegionInfo> |
createFsLayout(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
List<HRegionInfo> newRegions) |
protected static List<HRegionInfo> |
createFsLayout(MasterProcedureEnv env,
HTableDescriptor hTableDescriptor,
List<HRegionInfo> newRegions,
CreateTableProcedure.CreateHdfsRegions hdfsRegionHandler) |
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.CreateTableState state)
called to perform a single step of the specified 'state' of the procedure
|
protected MasterProcedureProtos.CreateTableState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
protected MasterProcedureProtos.CreateTableState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(MasterProcedureProtos.CreateTableState 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.CreateTableState 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.CreateTableState state)
Set the next state for the procedure.
|
void |
toStringClassDetails(StringBuilder sb)
Extend the toString() information with the procedure details
e.g.
|
protected static void |
updateTableDescCache(MasterProcedureEnv env,
TableName tableName) |
execute, rollbackaddStackIndex, 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, wasExecutedpublic CreateTableProcedure()
public CreateTableProcedure(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions)
public CreateTableProcedure(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions, ProcedurePrepareLatch syncLatch)
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, MasterProcedureProtos.CreateTableState state)
StateMachineProcedureexecuteFromState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>state - state to executeprotected void rollbackState(MasterProcedureEnv env, MasterProcedureProtos.CreateTableState state) throws IOException
StateMachineProcedurerollbackState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>state - state to rollbackIOException - temporary failure, the rollback will retry laterprotected MasterProcedureProtos.CreateTableState getState(int stateId)
StateMachineProceduregetState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>stateId - the ordinal() of the state enum (or state id)protected int getStateId(MasterProcedureProtos.CreateTableState state)
StateMachineProceduregetStateId in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>state - the state enum objectprotected MasterProcedureProtos.CreateTableState getInitialState()
StateMachineProceduregetInitialState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>protected void setNextState(MasterProcedureProtos.CreateTableState state)
StateMachineProceduresetNextState in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>state - the state enum objectpublic TableName getTableName()
getTableName in interface TableProcedureInterfacepublic TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterfacegetTableOperationType in interface TableProcedureInterfacepublic boolean abort(MasterProcedureEnv env)
Procedureabort in class Procedure<MasterProcedureEnv>public void toStringClassDetails(StringBuilder sb)
ProceduretoStringClassDetails in class Procedure<MasterProcedureEnv>sb - the string builder to use to append the proc specific informationpublic void serializeStateData(OutputStream stream) throws IOException
ProcedureserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>stream - the stream that will contain the user serialized dataIOExceptionpublic void deserializeStateData(InputStream stream) throws IOException
ProceduredeserializeStateData in class StateMachineProcedure<MasterProcedureEnv,MasterProcedureProtos.CreateTableState>stream - the stream that contains the user serialized dataIOExceptionprotected boolean acquireLock(MasterProcedureEnv env)
ProcedureacquireLock in class Procedure<MasterProcedureEnv>protected void releaseLock(MasterProcedureEnv env)
ProcedurereleaseLock in class Procedure<MasterProcedureEnv>protected static List<HRegionInfo> createFsLayout(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, List<HRegionInfo> newRegions) throws IOException
IOExceptionprotected static List<HRegionInfo> createFsLayout(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, List<HRegionInfo> newRegions, CreateTableProcedure.CreateHdfsRegions hdfsRegionHandler) throws IOException
IOExceptionprotected static List<HRegionInfo> addTableToMeta(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, List<HRegionInfo> regions) throws IOException
IOExceptionprotected static void assignRegions(MasterProcedureEnv env, TableName tableName, List<HRegionInfo> regions) throws HBaseException, IOException
HBaseExceptionIOExceptionprotected static void addRegionsToMeta(MasterProcedureEnv env, HTableDescriptor hTableDescriptor, List<HRegionInfo> regionInfos) throws IOException
IOExceptionprotected static void updateTableDescCache(MasterProcedureEnv env, TableName tableName) throws IOException
IOExceptionCopyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.