Class Join
- java.lang.Object
-
- org.elasticsearch.cluster.coordination.Join
-
- All Implemented Interfaces:
Writeable
public class Join extends java.lang.Object implements Writeable
Triggered by aStartJoinRequest
, instances of this class represent join votes, and have a source and target node. The source node is the node that provides the vote, and the target node is the node for which this vote is cast. A node will only cast a single vote per term, and this for a unique target node. The vote also carries information about the current state of the node that provided the vote, so that the receiver of the vote can determine if it has a more up-to-date state than the source node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Constructor Summary
Constructors Constructor Description Join(DiscoveryNode sourceNode, DiscoveryNode targetNode, long term, long lastAcceptedTerm, long lastAcceptedVersion)
Join(StreamInput in)
-
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object o)
long
getLastAcceptedTerm()
long
getLastAcceptedVersion()
DiscoveryNode
getSourceNode()
DiscoveryNode
getTargetNode()
long
getTerm()
int
hashCode()
boolean
targetMatches(DiscoveryNode matchingNode)
java.lang.String
toString()
void
writeTo(StreamOutput out)
Write this into the StreamOutput.
-
-
-
Constructor Detail
-
Join
public Join(DiscoveryNode sourceNode, DiscoveryNode targetNode, long term, long lastAcceptedTerm, long lastAcceptedVersion)
-
Join
public Join(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
getSourceNode
public DiscoveryNode getSourceNode()
-
getTargetNode
public DiscoveryNode getTargetNode()
-
targetMatches
public boolean targetMatches(DiscoveryNode matchingNode)
-
getLastAcceptedVersion
public long getLastAcceptedVersion()
-
getTerm
public long getTerm()
-
getLastAcceptedTerm
public long getLastAcceptedTerm()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-