Package org.elasticsearch.discovery.zen
Class ElectMasterService
java.lang.Object
org.elasticsearch.discovery.zen.ElectMasterService
public class ElectMasterService
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ElectMasterService.MasterCandidate
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 Setting<java.lang.Integer>
DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
-
Constructor Summary
Constructors Constructor Description ElectMasterService(Settings settings)
-
Method Summary
Modifier and Type Method Description int
countMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
ElectMasterService.MasterCandidate
electMaster(java.util.Collection<ElectMasterService.MasterCandidate> candidates)
Elects a new master out of the possible nodes, returning it.boolean
hasEnoughCandidates(java.util.Collection<ElectMasterService.MasterCandidate> candidates)
boolean
hasEnoughMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
boolean
hasTooManyMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
void
logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
int
minimumMasterNodes()
void
minimumMasterNodes(int minimumMasterNodes)
DiscoveryNode[]
nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)
Returns a list of the next possible masters.DiscoveryNode
tieBreakActiveMasters(java.util.Collection<DiscoveryNode> activeMasters)
selects the best active master to join, where multiple are discoveredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
public boolean hasEnoughCandidates(java.util.Collection<ElectMasterService.MasterCandidate> candidates) -
electMaster
public ElectMasterService.MasterCandidate electMaster(java.util.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.
-