Class ElectMasterService

java.lang.Object
org.elasticsearch.discovery.zen.ElectMasterService

public class ElectMasterService
extends java.lang.Object
  • Field Details

    • DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING

      public static final Setting<java.lang.Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
  • Constructor Details

    • ElectMasterService

      public ElectMasterService​(Settings settings)
  • Method Details

    • 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. Returns null if 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.