Package org.elasticsearch.discovery.zen
Class ElectMasterService
java.lang.Object
org.elasticsearch.discovery.zen.ElectMasterService
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
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
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
countMasterNodes(Iterable<DiscoveryNode> nodes)
electMaster(Collection<ElectMasterService.MasterCandidate> candidates)
Elects a new master out of the possible nodes, returning it.boolean
boolean
boolean
void
logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
int
void
minimumMasterNodes(int minimumMasterNodes)
nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)
Returns a list of the next possible masters.tieBreakActiveMasters(Collection<DiscoveryNode> activeMasters)
selects the best active master to join, where multiple are discovered
-
Field Details
-
DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
-
-
Constructor Details
-
ElectMasterService
-
-
Method Details
-
minimumMasterNodes
public void minimumMasterNodes(int minimumMasterNodes) -
minimumMasterNodes
public int minimumMasterNodes() -
countMasterNodes
-
hasEnoughCandidates
-
electMaster
public ElectMasterService.MasterCandidate electMaster(Collection<ElectMasterService.MasterCandidate> candidates)Elects a new master out of the possible nodes, returning it. Returnsnull
if no master has been elected. -
tieBreakActiveMasters
selects the best active master to join, where multiple are discovered -
hasEnoughMasterNodes
-
hasTooManyMasterNodes
-
logMinimumMasterNodesWarningIfNecessary
-
nextPossibleMasters
public DiscoveryNode[] nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)Returns a list of the next possible masters.
-