Package org.elasticsearch.discovery.zen
Class ElectMasterService
- java.lang.Object
-
- org.elasticsearch.discovery.zen.ElectMasterService
-
public class ElectMasterService extends 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<Integer>DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
-
Constructor Summary
Constructors Constructor Description ElectMasterService(Settings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountMasterNodes(Iterable<DiscoveryNode> nodes)ElectMasterService.MasterCandidateelectMaster(Collection<ElectMasterService.MasterCandidate> candidates)Elects a new master out of the possible nodes, returning it.booleanhasEnoughCandidates(Collection<ElectMasterService.MasterCandidate> candidates)booleanhasEnoughMasterNodes(Iterable<DiscoveryNode> nodes)booleanhasTooManyMasterNodes(Iterable<DiscoveryNode> nodes)voidlogMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)intminimumMasterNodes()voidminimumMasterNodes(int minimumMasterNodes)DiscoveryNode[]nextPossibleMasters(ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)Returns a list of the next possible masters.DiscoveryNodetieBreakActiveMasters(Collection<DiscoveryNode> activeMasters)selects the best active master to join, where multiple are discovered
-
-
-
Constructor Detail
-
ElectMasterService
public ElectMasterService(Settings settings)
-
-
Method Detail
-
minimumMasterNodes
public void minimumMasterNodes(int minimumMasterNodes)
-
minimumMasterNodes
public int minimumMasterNodes()
-
countMasterNodes
public int countMasterNodes(Iterable<DiscoveryNode> nodes)
-
hasEnoughCandidates
public boolean hasEnoughCandidates(Collection<ElectMasterService.MasterCandidate> candidates)
-
electMaster
public ElectMasterService.MasterCandidate electMaster(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(Collection<DiscoveryNode> activeMasters)
selects the best active master to join, where multiple are discovered
-
hasEnoughMasterNodes
public boolean hasEnoughMasterNodes(Iterable<DiscoveryNode> nodes)
-
hasTooManyMasterNodes
public boolean hasTooManyMasterNodes(Iterable<DiscoveryNode> nodes)
-
logMinimumMasterNodesWarningIfNecessary
public void logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
-
nextPossibleMasters
public DiscoveryNode[] nextPossibleMasters(ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)
Returns a list of the next possible masters.
-
-