Package org.elasticsearch.discovery.zen
Class ElectMasterService.MasterCandidate
- java.lang.Object
-
- org.elasticsearch.discovery.zen.ElectMasterService.MasterCandidate
-
- Enclosing class:
- ElectMasterService
public static class ElectMasterService.MasterCandidate extends java.lang.Object
a class to encapsulate all the information about a candidate in a master election that is needed to decided which of the candidates should win
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNRECOVERED_CLUSTER_VERSION
-
Constructor Summary
Constructors Constructor Description MasterCandidate(DiscoveryNode node, long clusterStateVersion)
-
Method Summary
Modifier and Type Method Description static int
compare(ElectMasterService.MasterCandidate c1, ElectMasterService.MasterCandidate c2)
compares two candidates to indicate which the a better master.long
getClusterStateVersion()
DiscoveryNode
getNode()
java.lang.String
toString()
-
-
-
Field Detail
-
UNRECOVERED_CLUSTER_VERSION
public static final long UNRECOVERED_CLUSTER_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MasterCandidate
public MasterCandidate(DiscoveryNode node, long clusterStateVersion)
-
-
Method Detail
-
getNode
public DiscoveryNode getNode()
-
getClusterStateVersion
public long getClusterStateVersion()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compare
public static int compare(ElectMasterService.MasterCandidate c1, ElectMasterService.MasterCandidate c2)
compares two candidates to indicate which the a better master. A higher cluster state version is better- Returns:
- -1 if c1 is a batter candidate, 1 if c2.
-
-