public class InstallRequest extends AbstractRaftRequest
Snapshot installation requests are sent by the leader to a follower when the follower indicates
that its log is further behind than the last snapshot taken by the leader. Snapshots are sent
in chunks, with each chunk being sent in a separate install request. As requests are received by
the follower, the snapshot is reconstructed based on the provided chunkOffset() and other
metadata. The last install request will be sent with complete() being true to
indicate that all chunks of the snapshot have been sent.
| Modifier and Type | Class and Description |
|---|---|
static class |
InstallRequest.Builder
Snapshot request builder.
|
| Constructor and Description |
|---|
InstallRequest(long term,
MemberId leader,
long serviceId,
String serviceName,
long index,
long timestamp,
int offset,
byte[] data,
boolean complete) |
| Modifier and Type | Method and Description |
|---|---|
int |
chunkOffset()
Returns the offset of the snapshot chunk.
|
boolean |
complete()
Returns a boolean value indicating whether this is the last chunk of the snapshot.
|
byte[] |
data()
Returns the snapshot data.
|
boolean |
equals(Object object) |
int |
hashCode() |
MemberId |
leader()
Returns the requesting leader address.
|
static InstallRequest.Builder |
newBuilder()
Returns a new install request builder.
|
long |
serviceId()
Returns the snapshot identifier.
|
String |
serviceName()
Returns the service name.
|
long |
snapshotIndex()
Returns the snapshot index.
|
long |
snapshotTimestamp()
Returns the snapshot timestamp.
|
long |
term()
Returns the requesting node's current term.
|
String |
toString() |
public static InstallRequest.Builder newBuilder()
public long term()
public MemberId leader()
public long serviceId()
public String serviceName()
public long snapshotIndex()
public long snapshotTimestamp()
public int chunkOffset()
public byte[] data()
public boolean complete()
Copyright © 2013–2017. All rights reserved.