S
- type of the message to sendR
- type of the message to receivepublic class SnapshotDownloader<S,R> extends Object implements io.grpc.stub.ClientResponseObserver<S,R>
Modifier and Type | Method and Description |
---|---|
void |
beforeStart(io.grpc.stub.ClientCallStreamObserver<S> requestStream) |
static SnapshotDownloader<DownloadSnapshotPRequest,DownloadSnapshotPResponse> |
forFollower(org.apache.ratis.statemachine.impl.SimpleStateMachineStorage storage,
String source)
Builds a stream for follower to download a snapshot.
|
static SnapshotDownloader<UploadSnapshotPResponse,UploadSnapshotPRequest> |
forLeader(org.apache.ratis.statemachine.impl.SimpleStateMachineStorage storage,
io.grpc.stub.StreamObserver<UploadSnapshotPResponse> stream,
String source)
Builds a stream for leader to download a snapshot.
|
CompletableFuture<org.apache.ratis.server.protocol.TermIndex> |
getFuture() |
org.apache.ratis.statemachine.SnapshotInfo |
getSnapshotToInstall() |
void |
onCompleted() |
void |
onError(Throwable t) |
void |
onNext(R response) |
public static SnapshotDownloader<UploadSnapshotPResponse,UploadSnapshotPRequest> forLeader(org.apache.ratis.statemachine.impl.SimpleStateMachineStorage storage, io.grpc.stub.StreamObserver<UploadSnapshotPResponse> stream, String source)
storage
- the snapshot storagestream
- the response streamsource
- the source of the snapshotpublic static SnapshotDownloader<DownloadSnapshotPRequest,DownloadSnapshotPResponse> forFollower(org.apache.ratis.statemachine.impl.SimpleStateMachineStorage storage, String source)
storage
- the snapshot storagesource
- the source of the snapshotpublic void onNext(R response)
onNext
in interface io.grpc.stub.StreamObserver<R>
public void onError(Throwable t)
onError
in interface io.grpc.stub.StreamObserver<R>
public void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<R>
public void beforeStart(io.grpc.stub.ClientCallStreamObserver<S> requestStream)
public CompletableFuture<org.apache.ratis.server.protocol.TermIndex> getFuture()
public org.apache.ratis.statemachine.SnapshotInfo getSnapshotToInstall()
Copyright © 2023. All Rights Reserved.