@InterfaceAudience.Private public abstract class ModifyStoreFileTrackerProcedure extends AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
ModifyTableProcedure
(or three if the table is already
in MIGRATION
but the dstSFT
is not what we expected) to do this, so we introduce
this procedure to simplify the work of our users.Modifier and Type | Class and Description |
---|---|
private static class |
ModifyStoreFileTrackerProcedure.StoreFileTrackerState |
StateMachineProcedure.Flow
Procedure.LockState
TableProcedureInterface.TableOperationType
Modifier and Type | Field and Description |
---|---|
private String |
dstSFT |
private static org.slf4j.Logger |
LOG |
private TableName |
tableName |
stateCount
NO_PROC_ID, NO_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
ModifyStoreFileTrackerProcedure() |
protected |
ModifyStoreFileTrackerProcedure(MasterProcedureEnv env,
TableName tableName,
String dstSFT) |
Modifier and Type | Method and Description |
---|---|
private void |
checkDstSFT(String dstSFT) |
private ModifyStoreFileTrackerProcedure.StoreFileTrackerState |
checkState(org.apache.hadoop.conf.Configuration conf,
String dstSFT) |
protected abstract org.apache.hadoop.conf.Configuration |
createConf(org.apache.hadoop.conf.Configuration conf,
TableDescriptor current) |
protected abstract TableDescriptor |
createFinishTableDescriptor(TableDescriptor current) |
protected abstract TableDescriptor |
createMigrationTableDescriptor(org.apache.hadoop.conf.Configuration conf,
TableDescriptor current) |
protected abstract TableDescriptor |
createRestoreTableDescriptor(TableDescriptor current,
String restoreSFT) |
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,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state)
called to perform a single step of the specified 'state' of the procedure
|
protected void |
finish(BiConsumer<String,String> setValue,
Consumer<String> removeValue) |
private void |
finish(MasterProcedureEnv env) |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState |
getInitialState()
Return the initial state object that will be used for the first call to executeFromState().
|
private String |
getRestoreSFT(org.apache.hadoop.conf.Configuration conf) |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState |
getState(int stateId)
Convert an ordinal (or state id) to an Enum (or more descriptive) state object.
|
protected int |
getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state)
Convert the Enum (or more descriptive) state object to an ordinal (or state id).
|
TableName |
getTableName()
Returns the name of the table the procedure is operating on
|
TableProcedureInterface.TableOperationType |
getTableOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
protected boolean |
isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state)
Used by the default implementation of abort() to know if the current state can be aborted and
rollback can be triggered.
|
protected void |
migrate(org.apache.hadoop.conf.Configuration conf,
BiConsumer<String,String> setValue) |
private void |
migrate(MasterProcedureEnv env) |
protected abstract void |
preCheck(TableDescriptor current) |
private StateMachineProcedure.Flow |
preCheckAndTryRestoreSFT(MasterProcedureEnv env) |
protected void |
rollbackState(MasterProcedureEnv env,
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState 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, isTableEnabled, preflightChecks, releaseLock, releaseSyncLatch, setUser, toStringClassDetails, waitInitialized
abort, addChildProcedure, execute, failIfAborted, getCurrentState, getCurrentStateId, getCycles, isEofState, isYieldAfterExecutionStep, isYieldBeforeExecuteFromState, rollback, setNextState, toStringState
addStackIndex, 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, wasExecuted
private static final org.slf4j.Logger LOG
protected ModifyStoreFileTrackerProcedure()
protected ModifyStoreFileTrackerProcedure(MasterProcedureEnv env, TableName tableName, String dstSFT) throws HBaseIOException
HBaseIOException
private void checkDstSFT(String dstSFT) throws DoNotRetryIOException
DoNotRetryIOException
public TableName getTableName()
TableProcedureInterface
getTableName
in interface TableProcedureInterface
getTableName
in class AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
public TableProcedureInterface.TableOperationType getTableOperationType()
TableProcedureInterface
getTableOperationType
in interface TableProcedureInterface
getTableOperationType
in class AbstractStateMachineTableProcedure<org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
private ModifyStoreFileTrackerProcedure.StoreFileTrackerState checkState(org.apache.hadoop.conf.Configuration conf, String dstSFT)
private final String getRestoreSFT(org.apache.hadoop.conf.Configuration conf)
protected abstract void preCheck(TableDescriptor current) throws IOException
IOException
protected abstract org.apache.hadoop.conf.Configuration createConf(org.apache.hadoop.conf.Configuration conf, TableDescriptor current)
protected abstract TableDescriptor createRestoreTableDescriptor(TableDescriptor current, String restoreSFT)
private StateMachineProcedure.Flow preCheckAndTryRestoreSFT(MasterProcedureEnv env) throws IOException
IOException
protected abstract TableDescriptor createMigrationTableDescriptor(org.apache.hadoop.conf.Configuration conf, TableDescriptor current)
protected final void migrate(org.apache.hadoop.conf.Configuration conf, BiConsumer<String,String> setValue)
protected abstract TableDescriptor createFinishTableDescriptor(TableDescriptor current)
protected final void finish(BiConsumer<String,String> setValue, Consumer<String> removeValue)
private void migrate(MasterProcedureEnv env) throws IOException
IOException
private void finish(MasterProcedureEnv env) throws IOException
IOException
protected StateMachineProcedure.Flow executeFromState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state) throws ProcedureSuspendedException, ProcedureYieldException, InterruptedException
StateMachineProcedure
executeFromState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
state
- state to executeProcedureSuspendedException
ProcedureYieldException
InterruptedException
protected void rollbackState(MasterProcedureEnv env, org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state) throws IOException, InterruptedException
StateMachineProcedure
rollbackState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
state
- state to rollbackIOException
- temporary failure, the rollback will retry laterInterruptedException
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState getState(int stateId)
StateMachineProcedure
getState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
stateId
- the ordinal() of the state enum (or state id)protected int getStateId(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state)
StateMachineProcedure
getStateId
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
state
- the state enum objectprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState getInitialState()
StateMachineProcedure
getInitialState
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
protected boolean isRollbackSupported(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState state)
StateMachineProcedure
isRollbackSupported
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class StateMachineProcedure<MasterProcedureEnv,org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProcedureProtos.ModifyStoreFileTrackerState>
serializer
- contains the serialized stateIOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.