Package io.atomix.raft.storage.log.entry
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 Summary
ConstructorsConstructorDescriptionConfigurationEntry(long timestamp, Collection<RaftMember> newMembers) ConfigurationEntry(long timestamp, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers) Creates an instance of aConfigurationEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenewMembersrecord component.Returns the value of theoldMembersrecord component.booleanlongReturns the value of thetimestamprecord component.toSerializable(long term, RaftEntrySerializer serializer) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConfigurationEntry
public ConfigurationEntry(long timestamp, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers) Creates an instance of aConfigurationEntryrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentnewMembers- the value for thenewMembersrecord componentoldMembers- the value for theoldMembersrecord component
-
ConfigurationEntry
-
-
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
- Specified by:
toSerializablein interfaceRaftEntry
-
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. -
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. -
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 '=='. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
newMembers
Returns the value of thenewMembersrecord component.- Returns:
- the value of the
newMembersrecord component
-
oldMembers
Returns the value of theoldMembersrecord component.- Returns:
- the value of the
oldMembersrecord component
-