Package io.atomix.raft.storage.system
Record Class Configuration
java.lang.Object
java.lang.Record
io.atomix.raft.storage.system.Configuration
- Record Components:
index- The index is the index of theConfigurationEntrywhich 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 Summary
ConstructorsConstructorDescriptionConfiguration(long index, long term, long time, Collection<RaftMember> members) Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers) Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers, boolean force) Creates an instance of aConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanforce()Returns the value of theforcerecord component.final inthashCode()Returns a hash code value for this object.booleanlongindex()Returns the value of theindexrecord component.Returns the value of thenewMembersrecord component.Returns the value of theoldMembersrecord component.booleanlongterm()Returns the value of thetermrecord component.longtime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Configuration
public Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers, boolean force) Creates an instance of aConfigurationrecord class.- Parameters:
index- the value for theindexrecord componentterm- the value for thetermrecord componenttime- the value for thetimerecord componentnewMembers- the value for thenewMembersrecord componentoldMembers- the value for theoldMembersrecord componentforce- the value for theforcerecord component
-
Configuration
public Configuration(long index, long term, long time, Collection<RaftMember> newMembers, Collection<RaftMember> oldMembers) -
Configuration
-
-
Method Details
-
requiresJointConsensus
public boolean requiresJointConsensus() -
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
typeis used.
-
hasMember
-
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 '=='. -
index
public long index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
term
public long term()Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-
time
public long time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord 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
-
force
public boolean force()Returns the value of theforcerecord component.- Returns:
- the value of the
forcerecord component
-