Преглед изворни кода

Add previously removed settings back for 8.0 (#78784)

Some recent PR's removed some deprecated settings from master. This PR re-adds the settings with deprecation enabled so that clusters can still start when they are specified, even if their features have been removed.
James Baiera пре 4 година
родитељ
комит
548bd30cef

+ 1 - 0
x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java

@@ -168,6 +168,7 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin
         settings.add(EnrichStatsCollector.STATS_TIMEOUT);
         settings.addAll(Exporters.getSettings());
         settings.add(Monitoring.MIGRATION_DECOMMISSION_ALERTS);
+        settings.addAll(MonitoringDeprecatedSettings.getSettings());
         return Collections.unmodifiableList(settings);
     }
 

+ 41 - 0
x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java

@@ -0,0 +1,41 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+package org.elasticsearch.xpack.monitoring;
+
+import org.elasticsearch.common.settings.Setting;
+import org.elasticsearch.common.settings.Setting.Property;
+import org.elasticsearch.core.TimeValue;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A collection of settings that are marked as deprecated and soon to be removed. These settings have been moved here because the features
+ * that make use of them have been removed from the code. Their removals can be enacted after the standard deprecation period has completed.
+ */
+public final class MonitoringDeprecatedSettings {
+    private MonitoringDeprecatedSettings() {}
+
+    // ===================
+    // Deprecated in 7.16:
+    public static final Setting.AffixSetting<Boolean> TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING =
+        Setting.affixKeySetting("xpack.monitoring.exporters.","index.template.create_legacy_templates",
+            (key) -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope, Property.Deprecated));
+    public static final Setting.AffixSetting<Boolean> USE_INGEST_PIPELINE_SETTING =
+        Setting.affixKeySetting("xpack.monitoring.exporters.","use_ingest",
+            key -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope, Property.Deprecated));
+    public static final Setting.AffixSetting<TimeValue> PIPELINE_CHECK_TIMEOUT_SETTING =
+        Setting.affixKeySetting("xpack.monitoring.exporters.","index.pipeline.master_timeout",
+            (key) -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Property.Dynamic, Property.NodeScope, Property.Deprecated));
+    // ===================
+
+    public static List<Setting.AffixSetting<?>> getSettings() {
+        return Arrays.asList(TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING, USE_INGEST_PIPELINE_SETTING, PIPELINE_CHECK_TIMEOUT_SETTING);
+    }
+
+}