public interface SnapshotExecutor extends Lifecycle<SnapshotExecutorOptions>, Describer
Describer.DefaultPrinter, Describer.Printer| 限定符和类型 | 方法和说明 |
|---|---|
void |
doSnapshot(Closure done)
Start to snapshot StateMachine, and |done| is called after the
execution finishes or fails.
|
NodeImpl |
getNode()
Return the owner NodeImpl
|
SnapshotStorage |
getSnapshotStorage()
Returns the backing snapshot storage
|
void |
installSnapshot(RpcRequests.InstallSnapshotRequest request,
RpcRequests.InstallSnapshotResponse.Builder response,
RpcRequestClosure done)
Install snapshot according to the very RPC from leader
After the installing succeeds (StateMachine is reset with the snapshot)
or fails, done will be called to respond
Errors:
- Term mismatches: which happens interrupt_downloading_snapshot was
called before install_snapshot, indicating that this RPC was issued by
the old leader
|
void |
interruptDownloadingSnapshots(long newTerm)
Interrupt the downloading if possible.
|
boolean |
isInstallingSnapshot()
Returns true if this is currently installing a snapshot, either
downloading or loading.
|
void |
join()
Block the current thread until all the running job finishes (including failure)
|
NodeImpl getNode()
void doSnapshot(Closure done)
done - snapshot callbackvoid installSnapshot(RpcRequests.InstallSnapshotRequest request, RpcRequests.InstallSnapshotResponse.Builder response, RpcRequestClosure done)
void interruptDownloadingSnapshots(long newTerm)
newTerm - new term numboolean isInstallingSnapshot()
SnapshotStorage getSnapshotStorage()
void join() throws InterruptedException
Copyright © 2021. All rights reserved.