java.lang.Object
org.jgroups.protocols.raft.RaftImpl
org.jgroups.protocols.raft.Follower
- Direct Known Subclasses:
Learner
Implements the behavior of a RAFT follower
- Since:
- 0.1
- Author:
- Bela Ban
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleInstallSnapshotRequest(org.jgroups.Message msg, org.jgroups.Address leader, long last_included_index, long last_included_term) Called when a snapshot sent by the leader is received by a follower.Methods inherited from class org.jgroups.protocols.raft.RaftImpl
destroy, getFirstIndexOfConflictingTerm, handleAppendEntriesRequest, handleAppendEntriesResponse, init, raft, raft
-
Constructor Details
-
Follower
-
-
Method Details
-
handleInstallSnapshotRequest
public void handleInstallSnapshotRequest(org.jgroups.Message msg, org.jgroups.Address leader, long last_included_index, long last_included_term) Description copied from class:RaftImplCalled when a snapshot sent by the leader is received by a follower. The follower needs to overwrite its snapshot file with the received bytes and reinitialize its log to last_inluded_index and create a dummy LogEntry with last_included_term at last_included_index. This is needed by the nextRaftImpl.handleAppendEntriesRequest(LogEntries, Address, int, int, int, int)call to compare to the previous index and term.- Overrides:
handleInstallSnapshotRequestin classRaftImpl- Parameters:
msg- The snapshot message sent by the leaderleader- The leader (= sender of the message)last_included_index- The last index that's reflected in the state (=snapshot) sent by the leader. Indices first_appended, commit_index and last_appended have to be set to last_included_indexlast_included_term- The last included term. The dummy entry needs to have this term, for comparison in the next handleAppendRequest() call.
-