public class ElectMasterService extends AbstractComponent
Modifier and Type | Class and 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
|
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.Integer> |
DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING |
deprecationLogger, logger, settings
Constructor and Description |
---|
ElectMasterService(Settings settings) |
Modifier and Type | Method and 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 discovered
|
logDeprecatedSetting, logRemovedSetting, nodeName
public static final Setting<java.lang.Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
public ElectMasterService(Settings settings)
public void minimumMasterNodes(int minimumMasterNodes)
public int minimumMasterNodes()
public int countMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
public boolean hasEnoughCandidates(java.util.Collection<ElectMasterService.MasterCandidate> candidates)
public ElectMasterService.MasterCandidate electMaster(java.util.Collection<ElectMasterService.MasterCandidate> candidates)
public DiscoveryNode tieBreakActiveMasters(java.util.Collection<DiscoveryNode> activeMasters)
public boolean hasEnoughMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
public boolean hasTooManyMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
public void logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
public DiscoveryNode[] nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)