public final class NoopRaftActorSnapshotCohort extends Object implements RaftActorSnapshotCohort
Modifier and Type | Field and Description |
---|---|
static NoopRaftActorSnapshotCohort |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
applySnapshot(Snapshot.State snapshotState)
This method is called to apply a snapshot installed by the leader.
|
void |
createSnapshot(akka.actor.ActorRef actorRef,
Optional<OutputStream> installSnapshotStream)
This method is called by the RaftActor when a snapshot needs to be
created.
|
Snapshot.State |
deserializeSnapshot(com.google.common.io.ByteSource snapshotBytes)
This method is called to de-serialize snapshot data that was previously serialized via
RaftActorSnapshotCohort.createSnapshot(akka.actor.ActorRef, java.util.Optional<java.io.OutputStream>)
to a State instance. |
public static final NoopRaftActorSnapshotCohort INSTANCE
public void createSnapshot(akka.actor.ActorRef actorRef, Optional<OutputStream> installSnapshotStream)
RaftActorSnapshotCohort
createSnapshot
in interface RaftActorSnapshotCohort
actorRef
- the actor to which to respondinstallSnapshotStream
- Optional OutputStream that is present if the snapshot is to also be installed
on a follower. The implementation must serialize its state to the OutputStream and return the
installSnapshotStream instance in the CaptureSnapshotReply along with the snapshot State instance.
The snapshot State is serialized directly to the snapshot store while the OutputStream is used to send
the state data to follower(s) in chunks. The RaftActorSnapshotCohort.deserializeSnapshot(com.google.common.io.ByteSource)
method is used to convert the
serialized data back to a State instance on the follower end. The serialization for snapshot install is
passed off so the cost of serialization is not charged to the raft actor's thread.public void applySnapshot(Snapshot.State snapshotState)
RaftActorSnapshotCohort
applySnapshot
in interface RaftActorSnapshotCohort
snapshotState
- a snapshot of the state of the actorpublic Snapshot.State deserializeSnapshot(com.google.common.io.ByteSource snapshotBytes)
RaftActorSnapshotCohort
RaftActorSnapshotCohort.createSnapshot(akka.actor.ActorRef, java.util.Optional<java.io.OutputStream>)
to a State instance.deserializeSnapshot
in interface RaftActorSnapshotCohort
snapshotBytes
- the ByteSource containing the serialized dataCopyright © 2019 OpenDaylight. All rights reserved.