Test RaftActor using a simple program
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / AppendEntriesReply.java
index 28f0f6b52b1d356de1f1d66d28cc38ef6981a25a..7524d8f2326f0d490c09daa9842130e4b5218984 100644 (file)
@@ -17,9 +17,24 @@ public class AppendEntriesReply extends AbstractRaftRPC{
     // prevLogIndex and prevLogTerm
     private final boolean success;
 
-    public AppendEntriesReply(long term, boolean success) {
+    // The index of the last entry in the followers log
+    // This will be used to set the matchIndex for the follower on the
+    // Leader
+    private final long logLastIndex;
+
+    private final long logLastTerm;
+
+    // The followerId - this will be used to figure out which follower is
+    // responding
+    private final String followerId;
+
+    public AppendEntriesReply(String followerId, long term, boolean success, long logLastIndex, long logLastTerm) {
         super(term);
+
+        this.followerId = followerId;
         this.success = success;
+        this.logLastIndex = logLastIndex;
+        this.logLastTerm = logLastTerm;
     }
 
     public long getTerm() {
@@ -29,4 +44,16 @@ public class AppendEntriesReply extends AbstractRaftRPC{
     public boolean isSuccess() {
         return success;
     }
+
+    public long getLogLastIndex() {
+        return logLastIndex;
+    }
+
+    public long getLogLastTerm() {
+        return logLastTerm;
+    }
+
+    public String getFollowerId() {
+        return followerId;
+    }
 }