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.
  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • masterCandidateMatches

      public boolean masterCandidateMatches(DiscoveryNode matchingNode)
    • 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.
    • votingNode

      public DiscoveryNode votingNode()
      Returns the value of the votingNode record component.
      Returns:
      the value of the votingNode record component
    • masterCandidateNode

      public DiscoveryNode masterCandidateNode()
      Returns the value of the masterCandidateNode record component.
      Returns:
      the value of the masterCandidateNode record component
    • term

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

      public long lastAcceptedTerm()
      Returns the value of the lastAcceptedTerm record component.
      Returns:
      the value of the lastAcceptedTerm record component
    • lastAcceptedVersion

      public long lastAcceptedVersion()
      Returns the value of the lastAcceptedVersion record component.
      Returns:
      the value of the lastAcceptedVersion record component