diff --git a/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java b/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java index 2437f1a43dcbc..b1bb84cff4d6f 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java @@ -352,7 +352,7 @@ public void apply(Settings value, Settings current, Settings previous) { Node.INITIAL_STATE_TIMEOUT_SETTING, DiscoveryModule.DISCOVERY_TYPE_SETTING, DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING, - DiscoveryModule.ELECTION_TYPE_SETTING, + DiscoveryModule.ELECTION_STRATEGY_SETTING, SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING, SeedHostsResolver.DISCOVERY_SEED_RESOLVER_MAX_CONCURRENT_RESOLVERS_SETTING, SeedHostsResolver.DISCOVERY_SEED_RESOLVER_TIMEOUT_SETTING, diff --git a/server/src/main/java/org/elasticsearch/discovery/DiscoveryModule.java b/server/src/main/java/org/elasticsearch/discovery/DiscoveryModule.java index 889790eca2ee4..63b24537c2dd9 100644 --- a/server/src/main/java/org/elasticsearch/discovery/DiscoveryModule.java +++ b/server/src/main/java/org/elasticsearch/discovery/DiscoveryModule.java @@ -76,10 +76,10 @@ public class DiscoveryModule { Setting.listSetting("discovery.seed_providers", Collections.emptyList(), Function.identity(), Property.NodeScope); - public static final String DEFAULT_ELECTION_TYPE = "default"; + public static final String DEFAULT_ELECTION_STRATEGY = "default"; - public static final Setting ELECTION_TYPE_SETTING = - new Setting<>("cluster.election.type", DEFAULT_ELECTION_TYPE, Function.identity(), Property.NodeScope); + public static final Setting ELECTION_STRATEGY_SETTING = + new Setting<>("cluster.election.strategy", DEFAULT_ELECTION_STRATEGY, Function.identity(), Property.NodeScope); private final Discovery discovery; @@ -93,7 +93,7 @@ public DiscoveryModule(Settings settings, ThreadPool threadPool, TransportServic hostProviders.put("settings", () -> new SettingsBasedSeedHostsProvider(settings, transportService)); hostProviders.put("file", () -> new FileBasedSeedHostsProvider(configFile)); final Map electionStrategies = new HashMap<>(); - electionStrategies.put(DEFAULT_ELECTION_TYPE, ElectionStrategy.DefaultElectionStrategy.INSTANCE); + electionStrategies.put(DEFAULT_ELECTION_STRATEGY, ElectionStrategy.DefaultElectionStrategy.INSTANCE); for (DiscoveryPlugin plugin : plugins) { plugin.getSeedHostProviders(transportService, networkService).forEach((key, value) -> { if (hostProviders.put(key, value) != null) { @@ -139,9 +139,9 @@ public DiscoveryModule(Settings settings, ThreadPool threadPool, TransportServic return Collections.unmodifiableList(addresses); }; - final ElectionStrategy electionStrategy = electionStrategies.get(ELECTION_TYPE_SETTING.get(settings)); + final ElectionStrategy electionStrategy = electionStrategies.get(ELECTION_STRATEGY_SETTING.get(settings)); if (electionStrategy == null) { - throw new IllegalArgumentException("Unknown election type " + ELECTION_TYPE_SETTING.get(settings)); + throw new IllegalArgumentException("Unknown election strategy " + ELECTION_STRATEGY_SETTING.get(settings)); } if (ZEN2_DISCOVERY_TYPE.equals(discoveryType) || SINGLE_NODE_DISCOVERY_TYPE.equals(discoveryType)) { diff --git a/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePlugin.java b/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePlugin.java index 866352fca462f..dcb2eef290199 100644 --- a/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePlugin.java +++ b/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/VotingOnlyNodePlugin.java @@ -61,7 +61,7 @@ public class VotingOnlyNodePlugin extends Plugin implements DiscoveryPlugin, Net public static final Setting VOTING_ONLY_NODE_SETTING = Setting.boolSetting("node.voting_only", false, Setting.Property.NodeScope); - private static final String VOTING_ONLY_ELECTION_TYPE = "supports_voting_only"; + private static final String VOTING_ONLY_ELECTION_STRATEGY = "supports_voting_only"; static DiscoveryNodeRole VOTING_ONLY_NODE_ROLE = new DiscoveryNodeRole("voting_only", "v") { @Override @@ -132,7 +132,7 @@ public Map getElectionStrategies() { if (XPackSettings.VOTING_ONLY_ENABLED.get(settings) == false) { return Collections.emptyMap(); } - return Collections.singletonMap(VOTING_ONLY_ELECTION_TYPE, new VotingOnlyNodeElectionStrategy()); + return Collections.singletonMap(VOTING_ONLY_ELECTION_STRATEGY, new VotingOnlyNodeElectionStrategy()); } @Override @@ -154,7 +154,7 @@ public Settings additionalSettings() { if (XPackSettings.VOTING_ONLY_ENABLED.get(settings) == false) { return Settings.EMPTY; } - return Settings.builder().put(DiscoveryModule.ELECTION_TYPE_SETTING.getKey(), VOTING_ONLY_ELECTION_TYPE).build(); + return Settings.builder().put(DiscoveryModule.ELECTION_STRATEGY_SETTING.getKey(), VOTING_ONLY_ELECTION_STRATEGY).build(); } static class VotingOnlyNodeElectionStrategy extends ElectionStrategy.DefaultElectionStrategy {