Record Class NetworkConsensusStatus

java.lang.Object
java.lang.Record
org.j7m.middleware.consensus.NetworkConsensusStatus
Record Components:
nodeId - local identity
term - durable election term
leaderId - known leader, or empty string
commitIndex - durable committed prefix
appliedIndex - application prefix
configEpoch - committed configuration generation
members - committed voting identities
jointMembers - proposed identities during joint consensus, otherwise empty

public record NetworkConsensusStatus(String nodeId, long term, String leaderId, long commitIndex, long appliedIndex, long configEpoch, Set<String> members, Set<String> jointMembers) extends Record
Immutable diagnostic view, not a linearizable read barrier.
  • Constructor Details

    • NetworkConsensusStatus

      public NetworkConsensusStatus(String nodeId, long term, String leaderId, long commitIndex, long appliedIndex, long configEpoch, Set<String> members, Set<String> jointMembers)
      Copies mutable membership inputs.
      Parameters:
      nodeId - local identity
      term - election term
      leaderId - leader identity
      commitIndex - committed index
      appliedIndex - applied index
      configEpoch - configuration epoch
      members - committed voters
      jointMembers - proposed voters
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • nodeId

      public String nodeId()
      Returns the value of the nodeId record component.
      Returns:
      the value of the nodeId record component
    • term

      public long term()
      Returns the value of the term record component.
      Returns:
      the value of the term record component
    • leaderId

      public String leaderId()
      Returns the value of the leaderId record component.
      Returns:
      the value of the leaderId record component
    • commitIndex

      public long commitIndex()
      Returns the value of the commitIndex record component.
      Returns:
      the value of the commitIndex record component
    • appliedIndex

      public long appliedIndex()
      Returns the value of the appliedIndex record component.
      Returns:
      the value of the appliedIndex record component
    • configEpoch

      public long configEpoch()
      Returns the value of the configEpoch record component.
      Returns:
      the value of the configEpoch record component
    • members

      public Set<String> members()
      Returns the value of the members record component.
      Returns:
      the value of the members record component
    • jointMembers

      public Set<String> jointMembers()
      Returns the value of the jointMembers record component.
      Returns:
      the value of the jointMembers record component