Record Class ConfigurationEntry

java.lang.Object
java.lang.Record
io.atomix.raft.storage.log.entry.ConfigurationEntry
All Implemented Interfaces:
RaftEntry

public record ConfigurationEntry(long timestamp, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers) extends Record implements RaftEntry
Stores a cluster configuration.

The ConfigurationEntry stores information relevant to a single cluster configuration change. Configuration change entries store a collection of newMembers which each represent a server in the cluster. Each time the set of members changes or a property of a single member changes, a new ConfigurationEntry must be logged for the configuration change. If the set of members changes, the ConfigurationEntry must be committed by a quorum of the old members and a quorum of the new members.

  • Constructor Details

    • ConfigurationEntry

      public ConfigurationEntry(long timestamp, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers)
      Creates an instance of a ConfigurationEntry record class.
      Parameters:
      timestamp - the value for the timestamp record component
      newMembers - the value for the newMembers record component
      oldMembers - the value for the oldMembers record component
    • ConfigurationEntry

      public ConfigurationEntry(long timestamp, Collection<RaftMember> newMembers)
  • Method Details

    • requiresJointConsensus

      public boolean requiresJointConsensus()
      Returns:
      true if the configuration change requires joint consensus, i.e. when the set of members has changed.
    • toSerializable

      public BufferWriter toSerializable(long term, RaftEntrySerializer serializer)
      Specified by:
      toSerializable in interface RaftEntry
    • 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.
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp 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