Record Class Configuration

java.lang.Object
java.lang.Record
io.atomix.raft.storage.system.Configuration
Record Components:
index - The index is the index of the ConfigurationEntry which resulted in this configuration.
term - The term is the term of the leader at the time the configuration change was committed.
time - The time at which the configuration was committed.
newMembers - The cluster membership for this configuration.
oldMembers - The cluster membership for the previous configuration.
force - True indicates, we are skipping joint consensus and force the configuration change without a quorum.

public record Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers, boolean force) extends Record
Represents a persisted server configuration.
  • Constructor Details

    • Configuration

      public Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers, boolean force)
      Creates an instance of a Configuration record class.
      Parameters:
      index - the value for the index record component
      term - the value for the term record component
      time - the value for the time record component
      newMembers - the value for the newMembers record component
      oldMembers - the value for the oldMembers record component
      force - the value for the force record component
    • Configuration

      public Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers)
    • Configuration

      public Configuration(long index, long term, long time, Collection<RaftMember> members)
  • Method Details

    • requiresJointConsensus

      public boolean requiresJointConsensus()
    • allMembers

      public Set<RaftMember> allMembers()
      Returns:
      a set of all members in the configuration. During joint consensus where a member can be in both the old and new configuration, the member with the higher type is used.
    • hasMember

      public boolean hasMember(MemberId member)
    • 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 '=='.
      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.
    • index

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

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

      public long time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • newMembers

      public Collection<RaftMember> newMembers()
      Returns the value of the newMembers record component.
      Returns:
      the value of the newMembers record component
    • oldMembers

      public Collection<RaftMember> oldMembers()
      Returns the value of the oldMembers record component.
      Returns:
      the value of the oldMembers record component
    • force

      public boolean force()
      Returns the value of the force record component.
      Returns:
      the value of the force record component