Class AppendResult

java.lang.Object
org.jgroups.protocols.raft.AppendResult
All Implemented Interfaces:
org.jgroups.util.Streamable

public class AppendResult extends Object implements org.jgroups.util.Streamable
The result of an AppendEntries request
Since:
0.1
Author:
Bela Ban
  • Field Details

    • result

      protected AppendResult.Result result
      True if the append succeeded, false otherwise
    • index

      protected long index
      The index of the last appended entry if success == true. If success is false, the first index for non-matching term. If index == 0, this means the follower doesn't have a log and needs to run the InstallSnapshot protocol to fetch the initial snapshot
    • commit_index

      protected long commit_index
      The commit_index of the follower
    • non_matching_term

      protected long non_matching_term
      Ignored if success == true. If success is false, the non-matching term.
  • Constructor Details

    • AppendResult

      public AppendResult()
    • AppendResult

      public AppendResult(AppendResult.Result result, long index)
    • AppendResult

      public AppendResult(AppendResult.Result result, long index, long non_matching_term)
  • Method Details

    • success

      public boolean success()
    • index

      public long index()
    • commitIndex

      public long commitIndex()
    • nonMatchingTerm

      public long nonMatchingTerm()
    • commitIndex

      public AppendResult commitIndex(long ci)
    • size

      public int size()
    • writeTo

      public void writeTo(DataOutput out) throws IOException
      Specified by:
      writeTo in interface org.jgroups.util.Streamable
      Throws:
      IOException
    • readFrom

      public void readFrom(DataInput in) throws IOException
      Specified by:
      readFrom in interface org.jgroups.util.Streamable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object