@InterfaceAudience.Private public class RefreshPeerProcedure extends Procedure<MasterProcedureEnv> implements PeerProcedureInterface, RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
Procedure.LockStatePeerProcedureInterface.PeerOperationTypeNO_PROC_ID, NO_TIMEOUT| Constructor and Description |
|---|
RefreshPeerProcedure() |
RefreshPeerProcedure(String peerId,
PeerProcedureInterface.PeerOperationType type,
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 |
deserializeStateData(ProcedureStateSerializer serializer)
Called on store load to allow the user to decode the previously serialized
state.
|
protected Procedure<MasterProcedureEnv>[] |
execute(MasterProcedureEnv env)
The main code of the procedure.
|
String |
getPeerId() |
PeerProcedureInterface.PeerOperationType |
getPeerOperationType() |
RemoteProcedureDispatcher.RemoteOperation |
remoteCallBuild(MasterProcedureEnv env,
ServerName remote)
For building the remote operation.
|
boolean |
remoteCallFailed(MasterProcedureEnv env,
ServerName remote,
IOException exception)
Called when the executeProcedure call is failed.
|
void |
remoteOperationCompleted(MasterProcedureEnv env)
Called when RS tells the remote procedure is succeeded through the
reportProcedureDone method. |
void |
remoteOperationFailed(MasterProcedureEnv env,
RemoteProcedureException error)
Called when RS tells the remote procedure is failed through the
reportProcedureDone
method. |
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. |
acquireLock, 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, 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, wasExecutedpublic RefreshPeerProcedure()
public RefreshPeerProcedure(String peerId, PeerProcedureInterface.PeerOperationType type, ServerName targetServer)
public String getPeerId()
getPeerId in interface PeerProcedureInterfacepublic PeerProcedureInterface.PeerOperationType getPeerOperationType()
getPeerOperationType in interface PeerProcedureInterfacepublic RemoteProcedureDispatcher.RemoteOperation remoteCallBuild(MasterProcedureEnv env, ServerName remote)
RemoteProcedureDispatcher.RemoteProcedureremoteCallBuild in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>public boolean remoteCallFailed(MasterProcedureEnv env, ServerName remote, IOException exception)
RemoteProcedureDispatcher.RemoteProcedureremoteCallFailed in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>public void remoteOperationCompleted(MasterProcedureEnv env)
RemoteProcedureDispatcher.RemoteProcedurereportProcedureDone method.remoteOperationCompleted in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>public void remoteOperationFailed(MasterProcedureEnv env, RemoteProcedureException error)
RemoteProcedureDispatcher.RemoteProcedurereportProcedureDone
method.remoteOperationFailed in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>protected Procedure<MasterProcedureEnv>[] execute(MasterProcedureEnv env) throws ProcedureYieldException, ProcedureSuspendedException, InterruptedException
Procedureexecute in class Procedure<MasterProcedureEnv>env - the environment passed to the ProcedureExecutorProcedureYieldException - the procedure will be added back to the queue and retried later.ProcedureSuspendedException - Signal to the executor that Procedure has suspended itself and
has set itself up waiting for an external event to wake it back up again.InterruptedException - the procedure will be added back to the queue and retried later.protected void rollback(MasterProcedureEnv env) throws IOException, InterruptedException
Procedurerollback 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)
ProcedureNOTE: 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)
ProcedureProcedure.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
ProcedureserializeStateData in class Procedure<MasterProcedureEnv>serializer - stores the serializable stateIOExceptionprotected void deserializeStateData(ProcedureStateSerializer serializer) throws IOException
ProceduredeserializeStateData in class Procedure<MasterProcedureEnv>serializer - contains the serialized stateIOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.