@InterfaceAudience.Private public class SyncReplicationReplayWALRemoteProcedure extends ServerRemoteProcedure implements PeerProcedureInterface
Procedure.LockState
PeerProcedureInterface.PeerOperationType
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private String |
peerId |
private List<String> |
wals |
dispatched, event, succ, targetServer
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
SyncReplicationReplayWALRemoteProcedure() |
SyncReplicationReplayWALRemoteProcedure(String peerId,
List<String> wals,
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.
|
String |
getPeerId() |
PeerProcedureInterface.PeerOperationType |
getPeerOperationType() |
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.
|
private void |
truncateWALs(MasterProcedureEnv env)
Only truncate wals one by one when task succeed.
|
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, 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, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
storeInDispatchedQueue
private static final org.slf4j.Logger LOG
public SyncReplicationReplayWALRemoteProcedure()
public SyncReplicationReplayWALRemoteProcedure(String peerId, List<String> wals, ServerName targetServer)
public Optional<RemoteProcedureDispatcher.RemoteOperation> remoteCallBuild(MasterProcedureEnv env, ServerName remote)
RemoteProcedureDispatcher.RemoteProcedure
remoteCallBuild
in interface RemoteProcedureDispatcher.RemoteProcedure<MasterProcedureEnv,ServerName>
protected void complete(MasterProcedureEnv env, Throwable error)
complete
in class ServerRemoteProcedure
private void truncateWALs(MasterProcedureEnv env)
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 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
public String getPeerId()
getPeerId
in interface PeerProcedureInterface
public PeerProcedureInterface.PeerOperationType getPeerOperationType()
getPeerOperationType
in interface PeerProcedureInterface
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.