Class SplitWALRemoteProcedure
java.lang.Object
org.apache.hadoop.hbase.procedure2.Procedure<MasterProcedureEnv>
org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure
org.apache.hadoop.hbase.master.procedure.SplitWALRemoteProcedure
- All Implemented Interfaces:
Comparable<Procedure<MasterProcedureEnv>>,ServerProcedureInterface,RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
@Private
public class SplitWALRemoteProcedure
extends ServerRemoteProcedure
implements ServerProcedureInterface
A remote procedure which is used to send split WAL request to region server. It will return null
if the task succeeded or return a DoNotRetryIOException.
SplitWALProcedure will help
handle the situation that encounters DoNotRetryIOException. Otherwise it will retry until
success.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.Procedure
Procedure.LockStateNested classes/interfaces inherited from interface org.apache.hadoop.hbase.master.procedure.ServerProcedureInterface
ServerProcedureInterface.ServerOperationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ServerNameprivate static final org.slf4j.Loggerprivate StringFields inherited from class org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure
event, remoteError, state, targetServerFields inherited from class org.apache.hadoop.hbase.procedure2.Procedure
NO_PROC_ID, NO_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionSplitWALRemoteProcedure(ServerName worker, ServerName crashedServer, String wal) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanabort(MasterProcedureEnv env) The abort() call is asynchronous and each procedure must decide how to deal with it, if they want to be abortable.protected booleancomplete(MasterProcedureEnv env, Throwable error) protected voiddeserializeStateData(ProcedureStateSerializer serializer) Called on store load to allow the user to decode the previously serialized state.Returns Name of this server instance.Given an operation type we can take decisions about what to do with pending operations.getWAL()booleanReturns True if this server has an hbase:meta table region.remoteCallBuild(MasterProcedureEnv env, ServerName serverName) For building the remote operation.protected voidThe code to undo what was done by the execute() code.protected voidserializeStateData(ProcedureStateSerializer serializer) The user-level code of the procedure may have some state to persist (e.g.protected voidtoStringClassDetails(StringBuilder builder) Extend the toString() information with the procedure details e.g.Methods inherited from class org.apache.hadoop.hbase.master.procedure.ServerRemoteProcedure
completionCleanup, execute, remoteCallFailed, remoteOperationCompleted, remoteOperationDone, remoteOperationFailedMethods inherited from class org.apache.hadoop.hbase.procedure2.Procedure
acquireLock, addStackIndex, afterExec, afterReplay, beforeExec, beforeReplay, bypass, compareTo, doExecute, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcedureMetrics, getProcId, getProcIdHashCode, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasOwner, hasParent, hasTimeout, haveSameParent, holdLock, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRollbackSupported, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, releaseLock, removeStackIndex, setAbortFailure, setChildrenLatch, setExecuted, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, suspend, toString, toStringClass, toStringDetails, toStringSimpleSB, toStringState, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecutedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.procedure2.RemoteProcedureDispatcher.RemoteProcedure
storeInDispatchedQueue
-
Field Details
-
LOG
-
walPath
-
crashedServer
-
-
Constructor Details
-
SplitWALRemoteProcedure
public SplitWALRemoteProcedure() -
SplitWALRemoteProcedure
-
-
Method Details
-
rollback
Description copied from class:ProcedureThe code to undo what was done by the execute() code. It is called when the procedure or one of the sub-procedures failed or an abort was requested. It should cleanup all the resources created by the execute() call. The implementation must be idempotent since rollback() may be called multiple time in case of machine failure in the middle of the execution.- Specified by:
rollbackin classProcedure<MasterProcedureEnv>- Parameters:
env- the environment passed to the ProcedureExecutor- Throws:
IOException- temporary failure, the rollback will retry laterInterruptedException- the procedure will be added back to the queue and retried later
-
abort
Description copied from class:ProcedureThe abort() call is asynchronous and each procedure must decide how to deal with it, if they want to be abortable. The simplest implementation is to have an AtomicBoolean set in the abort() method and then the execute() will check if the abort flag is set or not. abort() may be called multiple times from the client, so the implementation must be idempotent.NOTE: abort() is not like Thread.interrupt(). It is just a notification that allows the procedure implementor abort.
- Specified by:
abortin classProcedure<MasterProcedureEnv>
-
serializeStateData
Description copied from class:ProcedureThe user-level code of the procedure may have some state to persist (e.g. input arguments or current position in the processing state) to be able to resume on failure.- Specified by:
serializeStateDatain classProcedure<MasterProcedureEnv>- Parameters:
serializer- stores the serializable state- Throws:
IOException
-
deserializeStateData
Description copied from class:ProcedureCalled on store load to allow the user to decode the previously serialized state.- Specified by:
deserializeStateDatain classProcedure<MasterProcedureEnv>- Parameters:
serializer- contains the serialized state- Throws:
IOException
-
remoteCallBuild
public Optional<RemoteProcedureDispatcher.RemoteOperation> remoteCallBuild(MasterProcedureEnv env, ServerName serverName) Description copied from interface:RemoteProcedureDispatcher.RemoteProcedureFor building the remote operation. May be empty if no need to send remote call. Usually, this means the RemoteProcedure has been finished already. This is possible, as we may have already sent the procedure to RS but then the rpc connection is broken so the executeProcedures call fails, but the RS does receive the procedure and execute it and then report back, before we retry again.- Specified by:
remoteCallBuildin interfaceRemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
-
complete
- Specified by:
completein classServerRemoteProcedure
-
getWAL
-
getServerName
Description copied from interface:ServerProcedureInterfaceReturns Name of this server instance.- Specified by:
getServerNamein interfaceServerProcedureInterface
-
hasMetaTableRegion
Description copied from interface:ServerProcedureInterfaceReturns True if this server has an hbase:meta table region.- Specified by:
hasMetaTableRegionin interfaceServerProcedureInterface
-
getServerOperationType
Description copied from interface:ServerProcedureInterfaceGiven an operation type we can take decisions about what to do with pending operations. e.g. if we get a crash handler and we have some assignment operation pending we can abort those operations.- Specified by:
getServerOperationTypein interfaceServerProcedureInterface- Returns:
- the operation type that the procedure is executing.
-
toStringClassDetails
Description copied from class:ProcedureExtend the toString() information with the procedure details e.g. className and parameters- Overrides:
toStringClassDetailsin classProcedure<MasterProcedureEnv>- Parameters:
builder- the string builder to use to append the proc specific information
-
getProcName
- Overrides:
getProcNamein classProcedure<MasterProcedureEnv>
-