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%2Fmessages%2FAppendEntriesReply.java;h=7e6628abe1464800ef2449501a165a89c19cbcb3;hb=ed693440aa741fee9b94447f8404d89b4020f616;hp=28f0f6b52b1d356de1f1d66d28cc38ef6981a25a;hpb=583f6075e842a6a37b83bd01e478aebc70c6af73;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java index 28f0f6b52b..7e6628abe1 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java @@ -8,18 +8,35 @@ package org.opendaylight.controller.cluster.raft.messages; +import java.io.Serializable; + /** * Reply for the AppendEntriesRpc message */ -public class AppendEntriesReply extends AbstractRaftRPC{ +public class AppendEntriesReply extends AbstractRaftRPC implements Serializable { // true if follower contained entry matching // 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 +46,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; + } }