public class ElectMasterService extends AbstractComponent
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 |
---|---|
DiscoveryNode |
electMaster(java.lang.Iterable<DiscoveryNode> nodes)
Elects a new master out of the possible nodes, returning it.
|
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.
|
java.util.List<DiscoveryNode> |
sortByMasterLikelihood(java.lang.Iterable<DiscoveryNode> nodes)
Returns the given nodes sorted by likelihood of being elected as master, most likely first.
|
logDeprecatedSetting, logRemovedSetting, nodeName
public static final Setting<java.lang.Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING
public void minimumMasterNodes(int minimumMasterNodes)
public int minimumMasterNodes()
public boolean hasEnoughMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
public boolean hasTooManyMasterNodes(java.lang.Iterable<DiscoveryNode> nodes)
public void logMinimumMasterNodesWarningIfNecessary(ClusterState oldState, ClusterState newState)
public java.util.List<DiscoveryNode> sortByMasterLikelihood(java.lang.Iterable<DiscoveryNode> nodes)
public DiscoveryNode[] nextPossibleMasters(com.carrotsearch.hppc.ObjectContainer<DiscoveryNode> nodes, int numberOfPossibleMasters)
public DiscoveryNode electMaster(java.lang.Iterable<DiscoveryNode> nodes)