Class SingleNodeReconfigurator

java.lang.Object
org.elasticsearch.cluster.coordination.Reconfigurator
org.elasticsearch.cluster.coordination.stateless.SingleNodeReconfigurator

public class SingleNodeReconfigurator extends Reconfigurator
  • Constructor Details

  • Method Details

    • reconfigure

      public CoordinationMetadata.VotingConfiguration reconfigure(Set<DiscoveryNode> liveNodes, Set<String> retiredNodeIds, DiscoveryNode currentMaster, CoordinationMetadata.VotingConfiguration currentConfig)
      Description copied from class: Reconfigurator
      Compute an optimal configuration for the cluster.
      Overrides:
      reconfigure in class Reconfigurator
      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

      public ClusterState maybeReconfigureAfterNewMasterIsElected(ClusterState clusterState)
      Overrides:
      maybeReconfigureAfterNewMasterIsElected in class Reconfigurator
    • ensureVotingConfigCanBeModified

      public void ensureVotingConfigCanBeModified()
      Overrides:
      ensureVotingConfigCanBeModified in class Reconfigurator