X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FFollowerLogInformation.java;h=c5524bc1673801680cb002757b6b8edc004bb629;hb=655216a6c75aa29d31c4c56c56a5000db56ba233;hp=6d0c14e733a8c81bb2e29a663915eb5776422a6d;hpb=3c298061e7c22390eaf790aae977decfe0f94ad1;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java index 6d0c14e733..c5524bc167 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java @@ -25,10 +25,13 @@ public interface FollowerLogInformation { long decrNextIndex(); /** + * Sets the index of the next log entry for this follower. * * @param nextIndex + * @return true if the new index differed from the current index and the current index was updated, false + * otherwise. */ - void setNextIndex(long nextIndex); + boolean setNextIndex(long nextIndex); /** * Increment the value of the matchIndex @@ -36,7 +39,14 @@ public interface FollowerLogInformation { */ long incrMatchIndex(); - void setMatchIndex(long matchIndex); + /** + * Sets the index of the highest log entry for this follower. + * + * @param matchIndex + * @return true if the new index differed from the current index and the current index was updated, false + * otherwise. + */ + boolean setMatchIndex(long matchIndex); /** * The identifier of the follower @@ -73,4 +83,28 @@ public interface FollowerLogInformation { * This will stop the timeout clock */ void markFollowerInActive(); + + + /** + * This will return the active time of follower, since it was last reset + * @return time in milliseconds + */ + long timeSinceLastActivity(); + + /** + * This method checks if it is ok to replicate + * + * @return true if it is ok to replicate + */ + boolean okToReplicate(); + + /** + * Returns the payload data version of the follower. + */ + short getPayloadVersion(); + + /** + * Sets the payload data version of the follower. + */ + void setPayloadVersion(short payloadVersion); }