@InterfaceAudience.Private public class ClaimReplicationQueueRemoteProcedure extends ServerRemoteProcedure implements ServerProcedureInterface, RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
Procedure.LockState
ServerProcedureInterface.ServerOperationType
Modifier and Type | Field and Description |
---|---|
private ServerName |
crashedServer |
private static org.slf4j.Logger |
LOG |
private String |
queue |
dispatched, event, succ, targetServer
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
ClaimReplicationQueueRemoteProcedure() |
ClaimReplicationQueueRemoteProcedure(ServerName crashedServer,
String queue,
ServerName targetServer) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
abort(MasterProcedureEnv env)
The abort() call is asynchronous and each procedure must decide how to deal with it, if they
want to be abortable.
|
protected void |
complete(MasterProcedureEnv env,
Throwable error) |
protected void |
deserializeStateData(ProcedureStateSerializer serializer)
Called on store load to allow the user to decode the previously serialized state.
|
ServerName |
getServerName()
Returns Name of this server instance.
|
ServerProcedureInterface.ServerOperationType |
getServerOperationType()
Given an operation type we can take decisions about what to do with pending operations.
|
boolean |
hasMetaTableRegion()
Returns True if this server has an hbase:meta table region.
|
Optional<RemoteProcedureDispatcher.RemoteOperation> |
remoteCallBuild(MasterProcedureEnv env,
ServerName remote)
For building the remote operation.
|
protected void |
rollback(MasterProcedureEnv env)
The code to undo what was done by the execute() code.
|
protected void |
serializeStateData(ProcedureStateSerializer serializer)
The user-level code of the procedure may have some state to persist (e.g.
|
protected boolean |
waitInitialized(MasterProcedureEnv env)
The
Procedure.doAcquireLock(Object, ProcedureStore) will be split into two steps, first, it will
call us to determine whether we need to wait for initialization, second, it will call
Procedure.acquireLock(Object) to actually handle the lock for this procedure. |
completionCleanup, execute, remoteCallFailed, remoteOperationCompleted, remoteOperationFailed
acquireLock, 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, isYieldAfterExecutionStep, releaseLock, removeStackIndex, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
remoteCallFailed, remoteOperationCompleted, remoteOperationFailed, storeInDispatchedQueue
private static final org.slf4j.Logger LOG
private ServerName crashedServer
public ClaimReplicationQueueRemoteProcedure()
public ClaimReplicationQueueRemoteProcedure(ServerName crashedServer, String queue, ServerName targetServer)
public Optional<RemoteProcedureDispatcher.RemoteOperation> remoteCallBuild(MasterProcedureEnv env, ServerName remote)
RemoteProcedureDispatcher.RemoteProcedure
remoteCallBuild
in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
public ServerName getServerName()
ServerProcedureInterface
getServerName
in interface ServerProcedureInterface
public boolean hasMetaTableRegion()
ServerProcedureInterface
hasMetaTableRegion
in interface ServerProcedureInterface
public ServerProcedureInterface.ServerOperationType getServerOperationType()
ServerProcedureInterface
getServerOperationType
in interface ServerProcedureInterface
protected void complete(MasterProcedureEnv env, Throwable error)
complete
in class ServerRemoteProcedure
protected void rollback(MasterProcedureEnv env) throws IOException, InterruptedException
Procedure
rollback
in class Procedure<MasterProcedureEnv>
env
- the environment passed to the ProcedureExecutorIOException
- temporary failure, the rollback will retry laterInterruptedException
- the procedure will be added back to the queue and retried laterprotected boolean abort(MasterProcedureEnv env)
Procedure
NOTE: abort() is not like Thread.interrupt(). It is just a notification that allows the procedure implementor abort.
abort
in class Procedure<MasterProcedureEnv>
protected boolean waitInitialized(MasterProcedureEnv env)
Procedure
Procedure.doAcquireLock(Object, ProcedureStore)
will be split into two steps, first, it will
call us to determine whether we need to wait for initialization, second, it will call
Procedure.acquireLock(Object)
to actually handle the lock for this procedure.
This is because that when master restarts, we need to restore the lock state for all the
procedures to not break the semantic if Procedure.holdLock(Object)
is true. But the
ProcedureExecutor
will be started before the master finish initialization(as it is part
of the initialization!), so we need to split the code into two steps, and when restore, we just
restore the lock part and ignore the waitInitialized part. Otherwise there will be dead lock.waitInitialized
in class Procedure<MasterProcedureEnv>
protected void serializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
serializeStateData
in class Procedure<MasterProcedureEnv>
serializer
- stores the serializable stateIOException
protected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
Procedure
deserializeStateData
in class Procedure<MasterProcedureEnv>
serializer
- contains the serialized stateIOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.