Skip to content

Commit af36665

Browse files
authored
Deprecate the logstash enabled setting (#53487)
The setting, `xpack.logstash.enabled`, exists to enable or disable the logstash extensions found within x-pack. In practice, this setting had no effect on the functionality of the extension. Given this, the setting is now deprecated in preparation for removal. Backport of #53367
1 parent 34adfd9 commit af36665

File tree

7 files changed

+6
-21
lines changed

7 files changed

+6
-21
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ private NodeConfigurationSource createNodeConfigurationSource(final String leade
225225
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
226226
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
227227
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
228-
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
229228
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
230229
// Let cluster state api return quickly in order to speed up auto follow tests:
231230
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrSingleNodeTestCase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ protected Settings nodeSettings() {
4848
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
4949
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
5050
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
51-
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
5251
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
5352
// Let cluster state api return quickly in order to speed up auto follow tests:
5453
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private XPackSettings() {
8888

8989
/** Setting for enabling or disabling Logstash extensions. Defaults to true. */
9090
public static final Setting<Boolean> LOGSTASH_ENABLED = Setting.boolSetting("xpack.logstash.enabled", true,
91-
Setting.Property.NodeScope);
91+
Setting.Property.NodeScope, Property.Deprecated);
9292

9393
/**
9494
* Setting for enabling or disabling the index lifecycle extension. Defaults to true.

x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ protected Settings nodeSettings(int nodeOrdinal) {
101101
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
102102
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
103103
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
104-
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
105104
settings.put(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s");
106105

107106
// This is necessary to prevent ILM and SLM installing a lifecycle policy, these tests assume a blank slate

x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ protected Settings nodeSettings() {
5050
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
5151
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
5252
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
53-
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
5453
settings.put(Environment.PATH_REPO_SETTING.getKey(), repositoryLocation);
5554

5655
settings.put(XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED.getKey(), true);

x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.plugins.Plugin;
1616
import org.elasticsearch.plugins.SystemIndexPlugin;
1717
import org.elasticsearch.xpack.core.XPackPlugin;
18-
import org.elasticsearch.xpack.core.XPackSettings;
1918
import org.elasticsearch.xpack.core.template.TemplateUtils;
2019

2120
import java.util.ArrayList;
@@ -36,21 +35,7 @@ public class Logstash extends Plugin implements SystemIndexPlugin {
3635
private static final String OLD_LOGSTASH_INDEX_NAME = "logstash-index-template";
3736
private static final String TEMPLATE_VERSION_VARIABLE = "logstash.template.version";
3837

39-
private final boolean enabled;
40-
private final boolean transportClientMode;
41-
42-
public Logstash(Settings settings) {
43-
this.enabled = XPackSettings.LOGSTASH_ENABLED.get(settings);
44-
this.transportClientMode = XPackPlugin.transportClientMode(settings);
45-
}
46-
47-
boolean isEnabled() {
48-
return enabled;
49-
}
50-
51-
boolean isTransportClient() {
52-
return transportClientMode;
53-
}
38+
public Logstash() {}
5439

5540
public Collection<Module> createGuiceModules() {
5641
List<Module> modules = new ArrayList<>();

x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashFeatureSetTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
import org.elasticsearch.action.support.PlainActionFuture;
99
import org.elasticsearch.common.io.stream.BytesStreamOutput;
10+
import org.elasticsearch.common.settings.Setting;
1011
import org.elasticsearch.common.settings.Settings;
1112
import org.elasticsearch.license.XPackLicenseState;
1213
import org.elasticsearch.test.ESTestCase;
1314
import org.elasticsearch.xpack.core.XPackFeatureSet;
15+
import org.elasticsearch.xpack.core.XPackSettings;
1416
import org.elasticsearch.xpack.core.logstash.LogstashFeatureSetUsage;
1517

1618
import static org.mockito.Mockito.mock;
@@ -33,6 +35,8 @@ public void testEnabledSetting() throws Exception {
3335
usage.writeTo(out);
3436
XPackFeatureSet.Usage serializedUsage = new LogstashFeatureSetUsage(out.bytes().streamInput());
3537
assertThat(serializedUsage.enabled(), is(enabled));
38+
39+
assertSettingDeprecationsAndWarnings(new Setting<?>[] { XPackSettings.LOGSTASH_ENABLED });
3640
}
3741

3842
public void testEnabledDefault() throws Exception {

0 commit comments

Comments
 (0)