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 classElectMasterService.MasterCandidatea 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 intcountMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)ElectMasterService.MasterCandidateelectMaster(java.util.Collection<ElectMasterService.MasterCandidate> candidates)Elects a new master out of the possible nodes, returning it.booleanhasEnoughCandidates(java.util.Collection<ElectMasterService.MasterCandidate> candidates)booleanhasEnoughMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)booleanhasTooManyMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)voidlogMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)intminimumMasterNodes()voidminimumMasterNodes(int minimumMasterNodes)DiscoveryNode[]nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)Returns a list of the next possible masters.DiscoveryNodetieBreakActiveMasters(java.util.Collection<DiscoveryNode> activeMasters)selects the best active master to join, where multiple are discovered
-
Field Details
-
Constructor Details
-
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. Returnsnullif 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.
-