Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Change in AbstractRaftBehavior#performSnapshotWithoutCapture"
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
FollowerLogInformation.java
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 2c4304d404a57ca919cb0c71f274588c6654f6e5..0beccd1b2b01ead56d4ea73235a3687fd73f408b 100644
(file)
--- 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
@@
-5,11
+5,8
@@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.raft;
package org.opendaylight.controller.cluster.raft;
-import java.util.concurrent.atomic.AtomicLong;
-
/**
* The state of the followers log as known by the Leader
*/
/**
* The state of the followers log as known by the Leader
*/
@@
-19,58
+16,79
@@
public interface FollowerLogInformation {
* Increment the value of the nextIndex
* @return
*/
* Increment the value of the nextIndex
* @return
*/
-
public
long incrNextIndex();
+ long incrNextIndex();
/**
* Decrement the value of the nextIndex
* @return
*/
/**
* Decrement the value of the nextIndex
* @return
*/
-
public
long decrNextIndex();
+ long decrNextIndex();
/**
/**
+ * Sets the index of the next log entry for this follower.
*
* @param nextIndex
*
* @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
* @return
*/
/**
* Increment the value of the matchIndex
* @return
*/
-
public
long incrMatchIndex();
+ long incrMatchIndex();
- public 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
* This could simply be the url of the remote actor
*/
/**
* The identifier of the follower
* This could simply be the url of the remote actor
*/
-
public
String getId();
+ String getId();
/**
* for each server, index of the next log entry
* to send to that server (initialized to leader
* last log index + 1)
*/
/**
* for each server, index of the next log entry
* to send to that server (initialized to leader
* last log index + 1)
*/
-
public AtomicL
ong getNextIndex();
+
l
ong getNextIndex();
/**
* for each server, index of highest log entry
* known to be replicated on server
* (initialized to 0, increases monotonically)
*/
/**
* for each server, index of highest log entry
* known to be replicated on server
* (initialized to 0, increases monotonically)
*/
-
public AtomicL
ong getMatchIndex();
+
l
ong getMatchIndex();
/**
* Checks if the follower is active by comparing the last updated with the duration
* @return boolean
*/
/**
* Checks if the follower is active by comparing the last updated with the duration
* @return boolean
*/
-
public
boolean isFollowerActive();
+ boolean isFollowerActive();
/**
* restarts the timeout clock of the follower
*/
/**
* restarts the timeout clock of the follower
*/
-
public
void markFollowerActive();
+ void markFollowerActive();
+ /**
+ * 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();
}
}