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 Detail
-
DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
public static final Setting<java.lang.Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
-
-
Constructor Detail
-
ElectMasterService
public ElectMasterService(Settings settings)
-
-
Method Detail
-
minimumMasterNodes
public void minimumMasterNodes(int minimumMasterNodes)
-
minimumMasterNodes
public int minimumMasterNodes()
-
countMasterNodes
public int countMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
-
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
public DiscoveryNode tieBreakActiveMasters(java.util.Collection<DiscoveryNode> activeMasters)
selects the best active master to join, where multiple are discovered
-
hasEnoughMasterNodes
public boolean hasEnoughMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
-
hasTooManyMasterNodes
public boolean hasTooManyMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
-
logMinimumMasterNodesWarningIfNecessary
public void logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
-
nextPossibleMasters
public DiscoveryNode[] nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)
Returns a list of the next possible masters.
-
-