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
This commit is contained in:
Jay Modi 2020-03-12 10:18:39 -06:00 committed by GitHub
parent 34adfd9611
commit af36665b08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 6 additions and 21 deletions

View File

@ -225,7 +225,6 @@ public abstract class CcrIntegTestCase extends ESTestCase {
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
// Let cluster state api return quickly in order to speed up auto follow tests:
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));

View File

@ -48,7 +48,6 @@ public abstract class CcrSingleNodeTestCase extends ESSingleNodeTestCase {
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
// Let cluster state api return quickly in order to speed up auto follow tests:
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));

View File

@ -88,7 +88,7 @@ public class XPackSettings {
/** Setting for enabling or disabling Logstash extensions. Defaults to true. */
public static final Setting<Boolean> LOGSTASH_ENABLED = Setting.boolSetting("xpack.logstash.enabled", true,
Setting.Property.NodeScope);
Setting.Property.NodeScope, Property.Deprecated);
/**
* Setting for enabling or disabling the index lifecycle extension. Defaults to true.

View File

@ -101,7 +101,6 @@ public class IndexLifecycleInitialisationTests extends ESIntegTestCase {
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
settings.put(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s");
// This is necessary to prevent ILM and SLM installing a lifecycle policy, these tests assume a blank slate

View File

@ -50,7 +50,6 @@ public class SnapshotLifecycleInitialisationTests extends ESSingleNodeTestCase {
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
settings.put(Environment.PATH_REPO_SETTING.getKey(), repositoryLocation);
settings.put(XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED.getKey(), true);

View File

@ -15,7 +15,6 @@ import org.elasticsearch.indices.SystemIndexDescriptor;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.SystemIndexPlugin;
import org.elasticsearch.xpack.core.XPackPlugin;
import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.template.TemplateUtils;
import java.util.ArrayList;
@ -36,21 +35,7 @@ public class Logstash extends Plugin implements SystemIndexPlugin {
private static final String OLD_LOGSTASH_INDEX_NAME = "logstash-index-template";
private static final String TEMPLATE_VERSION_VARIABLE = "logstash.template.version";
private final boolean enabled;
private final boolean transportClientMode;
public Logstash(Settings settings) {
this.enabled = XPackSettings.LOGSTASH_ENABLED.get(settings);
this.transportClientMode = XPackPlugin.transportClientMode(settings);
}
boolean isEnabled() {
return enabled;
}
boolean isTransportClient() {
return transportClientMode;
}
public Logstash() {}
public Collection<Module> createGuiceModules() {
List<Module> modules = new ArrayList<>();

View File

@ -7,10 +7,12 @@ package org.elasticsearch.xpack.logstash;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.core.XPackFeatureSet;
import org.elasticsearch.xpack.core.XPackSettings;
import org.elasticsearch.xpack.core.logstash.LogstashFeatureSetUsage;
import static org.mockito.Mockito.mock;
@ -33,6 +35,8 @@ public class LogstashFeatureSetTests extends ESTestCase {
usage.writeTo(out);
XPackFeatureSet.Usage serializedUsage = new LogstashFeatureSetUsage(out.bytes().streamInput());
assertThat(serializedUsage.enabled(), is(enabled));
assertSettingDeprecationsAndWarnings(new Setting<?>[] { XPackSettings.LOGSTASH_ENABLED });
}
public void testEnabledDefault() throws Exception {