Record Class NetworkConsensusStatus
java.lang.Object
java.lang.Record
org.j7m.middleware.consensus.NetworkConsensusStatus
- Record Components:
nodeId- local identityterm- durable election termleaderId- known leader, or empty stringcommitIndex- durable committed prefixappliedIndex- application prefixconfigEpoch- committed configuration generationmembers- committed voting identitiesjointMembers- proposed identities during joint consensus, otherwise empty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theappliedIndexrecord component.longReturns the value of thecommitIndexrecord component.longReturns the value of theconfigEpochrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thejointMembersrecord component.leaderId()Returns the value of theleaderIdrecord component.members()Returns the value of themembersrecord component.nodeId()Returns the value of thenodeIdrecord component.longterm()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.
-
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 identityterm- election termleaderId- leader identitycommitIndex- committed indexappliedIndex- applied indexconfigEpoch- configuration epochmembers- committed votersjointMembers- proposed voters
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
nodeId
-
term
-
leaderId
-
commitIndex
public long commitIndex()Returns the value of thecommitIndexrecord component.- Returns:
- the value of the
commitIndexrecord component
-
appliedIndex
public long appliedIndex()Returns the value of theappliedIndexrecord component.- Returns:
- the value of the
appliedIndexrecord component
-
configEpoch
public long configEpoch()Returns the value of theconfigEpochrecord component.- Returns:
- the value of the
configEpochrecord component
-
members
-
jointMembers
Returns the value of thejointMembersrecord component.- Returns:
- the value of the
jointMembersrecord component
-