java.lang.Object
java.lang.Record
org.elasticsearch.cluster.coordination.Join
- Record Components:
votingNode
- The node casting a vote for a master candidate.masterCandidateNode
- The master candidate node receiving the vote for election.term
-lastAcceptedTerm
-lastAcceptedVersion
-
- All Implemented Interfaces:
Writeable
public record Join(DiscoveryNode votingNode, DiscoveryNode masterCandidateNode, long term, long lastAcceptedTerm, long lastAcceptedVersion)
extends Record
implements Writeable
Triggered by a
StartJoinRequest
, instances of this class represent join votes,
and have a voting and master-candidate node. The voting node is the node that provides
the vote, and the master-candidate node is the node for which this vote is cast. A join
vote is cast to reform the cluster around a particular master-eligible node, to elect
that node as the new master in a new term.
A voting node will only cast a single vote per term. The vote includes information about
the current state of the node casting the vote, so that the candidate for the vote can
determine whether it has a more up-to-date state than the voting node.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Constructor Summary
ConstructorsConstructorDescriptionJoin
(DiscoveryNode votingNode, DiscoveryNode masterCandidateNode, long term, long lastAcceptedTerm, long lastAcceptedVersion) Creates an instance of aJoin
record class.Join
(StreamInput in) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
Returns the value of thelastAcceptedTerm
record component.long
Returns the value of thelastAcceptedVersion
record component.boolean
masterCandidateMatches
(DiscoveryNode matchingNode) Returns the value of themasterCandidateNode
record component.long
term()
Returns the value of theterm
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thevotingNode
record component.void
writeTo
(StreamOutput out) Write this into the StreamOutput.
-
Constructor Details
-
Join
public Join(DiscoveryNode votingNode, DiscoveryNode masterCandidateNode, long term, long lastAcceptedTerm, long lastAcceptedVersion) Creates an instance of aJoin
record class.- Parameters:
votingNode
- the value for thevotingNode
record componentmasterCandidateNode
- the value for themasterCandidateNode
record componentterm
- the value for theterm
record componentlastAcceptedTerm
- the value for thelastAcceptedTerm
record componentlastAcceptedVersion
- the value for thelastAcceptedVersion
record component
-
Join
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
masterCandidateMatches
-
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 '=='. -
votingNode
Returns the value of thevotingNode
record component.- Returns:
- the value of the
votingNode
record component
-
masterCandidateNode
Returns the value of themasterCandidateNode
record component.- Returns:
- the value of the
masterCandidateNode
record component
-
term
public long term()Returns the value of theterm
record component.- Returns:
- the value of the
term
record component
-
lastAcceptedTerm
public long lastAcceptedTerm()Returns the value of thelastAcceptedTerm
record component.- Returns:
- the value of the
lastAcceptedTerm
record component
-
lastAcceptedVersion
public long lastAcceptedVersion()Returns the value of thelastAcceptedVersion
record component.- Returns:
- the value of the
lastAcceptedVersion
record component
-