+ private class InitialSyncStatusTracker {
+
+ private static final long INVALID_LOG_INDEX = -2L;
+ private long initialLeaderCommit = INVALID_LOG_INDEX;
+ private boolean initialSyncUpDone = false;
+ private String syncedLeaderId = null;
+ private final ActorRef actor;
+
+ public InitialSyncStatusTracker(ActorRef actor) {
+ this.actor = actor;
+ }
+
+ public void update(String leaderId, long leaderCommit, long commitIndex){
+
+ if(!leaderId.equals(syncedLeaderId)){
+ initialSyncUpDone = false;
+ initialLeaderCommit = INVALID_LOG_INDEX;
+ syncedLeaderId = leaderId;
+ }