From 37ee517c970e276913e335d426ea26ee609cb375 Mon Sep 17 00:00:00 2001 From: James Baiera Date: Wed, 6 Oct 2021 15:09:01 -0400 Subject: [PATCH] Add previously removed settings back for 8.0 --- .../xpack/monitoring/Monitoring.java | 1 + .../MonitoringDeprecatedSettings.java | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index 50688b621c0ff..17efb21fb23d2 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -168,6 +168,7 @@ public List> getSettings() { settings.add(EnrichStatsCollector.STATS_TIMEOUT); settings.addAll(Exporters.getSettings()); settings.add(Monitoring.MIGRATION_DECOMMISSION_ALERTS); + settings.addAll(MonitoringDeprecatedSettings.getSettings()); return Collections.unmodifiableList(settings); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java new file mode 100644 index 0000000000000..3b6a5370a5151 --- /dev/null +++ b/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 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 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 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> getSettings() { + return Arrays.asList(TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING, USE_INGEST_PIPELINE_SETTING, PIPELINE_CHECK_TIMEOUT_SETTING); + } + +}