Module org.elasticsearch.server
Class SingleNodeReconfigurator
java.lang.Object
org.elasticsearch.cluster.coordination.Reconfigurator
org.elasticsearch.cluster.coordination.stateless.SingleNodeReconfigurator
-
Field Summary
Fields inherited from class org.elasticsearch.cluster.coordination.Reconfigurator
CLUSTER_AUTO_SHRINK_VOTING_CONFIGURATION -
Constructor Summary
ConstructorsConstructorDescriptionSingleNodeReconfigurator(Settings settings, ClusterSettings clusterSettings) -
Method Summary
Modifier and TypeMethodDescriptionvoidmaybeReconfigureAfterNewMasterIsElected(ClusterState clusterState) reconfigure(Set<DiscoveryNode> liveNodes, Set<String> retiredNodeIds, DiscoveryNode currentMaster, CoordinationMetadata.VotingConfiguration currentConfig) Compute an optimal configuration for the cluster.Methods inherited from class org.elasticsearch.cluster.coordination.Reconfigurator
setAutoShrinkVotingConfiguration, toString
-
Constructor Details
-
SingleNodeReconfigurator
-
-
Method Details
-
reconfigure
public CoordinationMetadata.VotingConfiguration reconfigure(Set<DiscoveryNode> liveNodes, Set<String> retiredNodeIds, DiscoveryNode currentMaster, CoordinationMetadata.VotingConfiguration currentConfig) Description copied from class:ReconfiguratorCompute an optimal configuration for the cluster.- Overrides:
reconfigurein classReconfigurator- Parameters:
liveNodes- The live nodes in the cluster. The optimal configuration prefers live nodes over non-live nodes as far as possible.retiredNodeIds- Nodes that are leaving the cluster and which should not appear in the configuration if possible. Nodes that are retired and not in the current configuration will never appear in the resulting configuration; this is useful for shifting the vote in a 2-node cluster so one of the nodes can be restarted without harming availability.currentMaster- The current master. Unless retired, we prefer to keep the current master in the config.currentConfig- The current configuration. As far as possible, we prefer to keep the current config as-is.- Returns:
- An optimal configuration, or leave the current configuration unchanged if the optimal configuration has no live quorum.
-
maybeReconfigureAfterNewMasterIsElected
- Overrides:
maybeReconfigureAfterNewMasterIsElectedin classReconfigurator
-
ensureVotingConfigCanBeModified
public void ensureVotingConfigCanBeModified()- Overrides:
ensureVotingConfigCanBeModifiedin classReconfigurator
-