Update Setting according to changes in master
We changed Setting signatures in master branch of elasticsearch. We need to adapt x-plugins to the new code. See https://github.com/elastic/elasticsearch/pull/16629. Closes elastic/elasticsearch#1684. Original commit: elastic/x-pack-elasticsearch@c911aaca69
This commit is contained in:
parent
c739e9b61f
commit
5a1fbe6d62
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.graph;
|
||||
|
||||
import static org.elasticsearch.common.settings.Setting.Scope.CLUSTER;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -73,7 +71,7 @@ public class Graph extends Plugin {
|
|||
}
|
||||
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(Setting.boolSetting(XPackPlugin.featureEnabledSetting(NAME), true, false, CLUSTER));
|
||||
module.registerSetting(Setting.boolSetting(XPackPlugin.featureEnabledSetting(NAME), true, Setting.Property.NodeScope));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -84,6 +84,6 @@ public class Licensing {
|
|||
|
||||
public void onModule(SettingsModule module) {
|
||||
// TODO convert this wildcard to a real setting
|
||||
module.registerSetting(Setting.groupSetting("license.", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.groupSetting("license.", Setting.Property.NodeScope));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ public abstract class TestConsumerPluginBase extends Plugin {
|
|||
|
||||
public void onModule(SettingsModule module) {
|
||||
try {
|
||||
module.registerSetting(Setting.simpleString("_trial_license_duration_in_seconds", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("_grace_duration_in_seconds", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("_trial_license_duration_in_seconds", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("_grace_duration_in_seconds", Setting.Property.NodeScope));
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// already loaded
|
||||
}
|
||||
|
|
|
@ -20,6 +20,13 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static org.elasticsearch.common.settings.Setting.Property;
|
||||
import static org.elasticsearch.common.settings.Setting.boolSetting;
|
||||
import static org.elasticsearch.common.settings.Setting.groupSetting;
|
||||
import static org.elasticsearch.common.settings.Setting.intSetting;
|
||||
import static org.elasticsearch.common.settings.Setting.listSetting;
|
||||
import static org.elasticsearch.common.settings.Setting.timeSetting;
|
||||
|
||||
public class MarvelSettings extends AbstractComponent {
|
||||
|
||||
public static final String LEGACY_DATA_INDEX_NAME = ".marvel-es-data";
|
||||
|
@ -37,80 +44,80 @@ public class MarvelSettings extends AbstractComponent {
|
|||
(s) -> String.valueOf(!XPackPlugin.isTribeNode(s) && !XPackPlugin.isTribeClientNode(s)),
|
||||
|
||||
Booleans::parseBooleanExact,
|
||||
false,
|
||||
Setting.Scope.CLUSTER);
|
||||
Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Sampling interval between two collections (default to 10s)
|
||||
*/
|
||||
public static final Setting<TimeValue> INTERVAL =
|
||||
Setting.timeSetting(key("agent.interval"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.interval"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Timeout value when collecting index statistics (default to 10m)
|
||||
*/
|
||||
public static final Setting<TimeValue> INDEX_STATS_TIMEOUT =
|
||||
Setting.timeSetting(key("agent.index.stats.timeout"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.index.stats.timeout"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Timeout value when collecting total indices statistics (default to 10m)
|
||||
*/
|
||||
public static final Setting<TimeValue> INDICES_STATS_TIMEOUT =
|
||||
Setting.timeSetting(key("agent.indices.stats.timeout"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.indices.stats.timeout"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* List of indices names whose stats will be exported (default to all indices)
|
||||
*/
|
||||
public static final Setting<List<String>> INDICES =
|
||||
Setting.listSetting(key("agent.indices"), Collections.emptyList(), Function.identity(), true, Setting.Scope.CLUSTER);
|
||||
listSetting(key("agent.indices"), Collections.emptyList(), Function.identity(), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Timeout value when collecting the cluster state (default to 10m)
|
||||
*/
|
||||
public static final Setting<TimeValue> CLUSTER_STATE_TIMEOUT =
|
||||
Setting.timeSetting(key("agent.cluster.state.timeout"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.cluster.state.timeout"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Timeout value when collecting the recovery information (default to 10m)
|
||||
*/
|
||||
public static final Setting<TimeValue> CLUSTER_STATS_TIMEOUT =
|
||||
Setting.timeSetting(key("agent.cluster.stats.timeout"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.cluster.stats.timeout"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Timeout value when collecting the recovery information (default to 10m)
|
||||
*/
|
||||
public static final Setting<TimeValue> INDEX_RECOVERY_TIMEOUT =
|
||||
Setting.timeSetting(key("agent.index.recovery.timeout"), TimeValue.timeValueSeconds(10), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key("agent.index.recovery.timeout"), TimeValue.timeValueSeconds(10), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* Flag to indicate if only active recoveries should be collected (default to false: all recoveries are collected)
|
||||
*/
|
||||
public static final Setting<Boolean> INDEX_RECOVERY_ACTIVE_ONLY =
|
||||
Setting.boolSetting(key("agent.index.recovery.active_only"), false, true, Setting.Scope.CLUSTER) ;
|
||||
boolSetting(key("agent.index.recovery.active_only"), false, Property.Dynamic, Property.NodeScope) ;
|
||||
|
||||
/**
|
||||
* List of collectors allowed to collect data (default to all)
|
||||
*/
|
||||
public static final Setting<List<String>> COLLECTORS =
|
||||
Setting.listSetting(key("agent.collectors"), Collections.emptyList(), Function.identity(), false, Setting.Scope.CLUSTER);
|
||||
listSetting(key("agent.collectors"), Collections.emptyList(), Function.identity(), Property.NodeScope);
|
||||
|
||||
/**
|
||||
* The default retention duration of the monitoring history data
|
||||
*/
|
||||
public static final Setting<TimeValue> HISTORY_DURATION =
|
||||
Setting.timeSetting(key(HISTORY_DURATION_SETTING_NAME), TimeValue.timeValueHours(7 * 24), true, Setting.Scope.CLUSTER);
|
||||
timeSetting(key(HISTORY_DURATION_SETTING_NAME), TimeValue.timeValueHours(7 * 24), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* The index setting that holds the template version
|
||||
*/
|
||||
public static final Setting<Integer> INDEX_TEMPLATE_VERSION =
|
||||
Setting.intSetting("index.xpack.monitoring.template.version", MarvelTemplateUtils.TEMPLATE_VERSION, true, Setting.Scope.INDEX);
|
||||
intSetting("index.xpack.monitoring.template.version", MarvelTemplateUtils.TEMPLATE_VERSION,
|
||||
Property.Dynamic, Property.IndexScope);
|
||||
|
||||
/**
|
||||
* Settings/Options per configured exporter
|
||||
*/
|
||||
public static final Setting<Settings> EXPORTERS_SETTINGS =
|
||||
Setting.groupSetting(key("agent.exporters."), true, Setting.Scope.CLUSTER);
|
||||
groupSetting(key("agent.exporters."), Property.Dynamic, Property.NodeScope);
|
||||
|
||||
static void register(SettingsModule module) {
|
||||
module.registerSetting(INDICES);
|
||||
|
|
|
@ -153,7 +153,7 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
|
|||
public static abstract class Timestamped<T extends MonitoringDoc> extends MonitoringIndexNameResolver<T> {
|
||||
|
||||
public static final Setting<String> INDEX_NAME_TIME_FORMAT_SETTING = new Setting<>("index.name.time_format","YYYY.MM.dd",
|
||||
Function.identity(), false, Setting.Scope.CLUSTER);
|
||||
Function.identity(), Setting.Property.NodeScope);
|
||||
|
||||
private final String id;
|
||||
private final DateTimeFormatter formatter;
|
||||
|
|
|
@ -177,25 +177,25 @@ public class Shield {
|
|||
settingsModule.registerSetting(IPFilter.TRANSPORT_FILTER_DENY_SETTING);
|
||||
XPackPlugin.registerFeatureEnabledSettings(settingsModule, NAME, true);
|
||||
XPackPlugin.registerFeatureEnabledSettings(settingsModule, DLS_FLS_FEATURE, true);
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.audit.", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.listSetting("shield.hide_settings", Collections.emptyList(), Function.identity(), false,
|
||||
Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.ssl.", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.authc.", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.authz.store.files.roles", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.system_key.file", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.audit.", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.listSetting("shield.hide_settings", Collections.emptyList(), Function.identity(),
|
||||
Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.ssl.", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.groupSetting("shield.authc.", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.authz.store.files.roles", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.system_key.file", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.boolSetting(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING,
|
||||
ShieldNettyHttpServerTransport.HTTP_SSL_DEFAULT, false, Setting.Scope.CLUSTER));
|
||||
ShieldNettyHttpServerTransport.HTTP_SSL_DEFAULT, Setting.Property.NodeScope));
|
||||
// FIXME need to register a real setting with the defaults here
|
||||
settingsModule.registerSetting(Setting.simpleString(ShieldNettyHttpServerTransport.HTTP_CLIENT_AUTH_SETTING,
|
||||
false, Setting.Scope.CLUSTER));
|
||||
Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.boolSetting(ShieldNettyTransport.TRANSPORT_SSL_SETTING,
|
||||
ShieldNettyTransport.TRANSPORT_SSL_DEFAULT, false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString(ShieldNettyTransport.TRANSPORT_CLIENT_AUTH_SETTING, false,
|
||||
Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.user", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.encryption_key.algorithm", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.encryption.algorithm", false, Setting.Scope.CLUSTER));
|
||||
ShieldNettyTransport.TRANSPORT_SSL_DEFAULT, Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString(ShieldNettyTransport.TRANSPORT_CLIENT_AUTH_SETTING,
|
||||
Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.user", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.encryption_key.algorithm", Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.encryption.algorithm", Setting.Property.NodeScope));
|
||||
|
||||
String[] asArray = settings.getAsArray("shield.hide_settings");
|
||||
for (String pattern : asArray) {
|
||||
|
|
|
@ -41,23 +41,24 @@ public class IPFilter {
|
|||
*/
|
||||
public static final String HTTP_PROFILE_NAME = ".http";
|
||||
|
||||
public static final Setting<Boolean> IP_FILTER_ENABLED_HTTP_SETTING = Setting.boolSetting("shield.http.filter.enabled", true, true,
|
||||
Setting.Scope.CLUSTER);
|
||||
public static final Setting<Boolean> IP_FILTER_ENABLED_HTTP_SETTING = Setting.boolSetting("shield.http.filter.enabled", true,
|
||||
Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
public static final Setting<Boolean> IP_FILTER_ENABLED_SETTING = new Setting<>("shield.transport.filter.enabled", (s) ->
|
||||
IP_FILTER_ENABLED_HTTP_SETTING.getDefaultRaw(s), Booleans::parseBooleanExact, true, Setting.Scope.CLUSTER);
|
||||
IP_FILTER_ENABLED_HTTP_SETTING.getDefaultRaw(s), Booleans::parseBooleanExact, Setting.Property.Dynamic,
|
||||
Setting.Property.NodeScope);
|
||||
public static final Setting<List<String>> TRANSPORT_FILTER_ALLOW_SETTING = Setting.listSetting("shield.transport.filter.allow",
|
||||
Collections.emptyList(), Function.identity(), true, Setting.Scope.CLUSTER);
|
||||
Collections.emptyList(), Function.identity(), Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
public static final Setting<List<String>> TRANSPORT_FILTER_DENY_SETTING = Setting.listSetting("shield.transport.filter.deny",
|
||||
Collections.emptyList(), Function.identity(), true, Setting.Scope.CLUSTER);
|
||||
Collections.emptyList(), Function.identity(), Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
public static final Setting<List<String>> HTTP_FILTER_ALLOW_SETTING = Setting.listSetting("shield.http.filter.allow", (s) -> {
|
||||
return Arrays.asList(s.getAsArray("transport.profiles.default.shield.filter.allow",
|
||||
TRANSPORT_FILTER_ALLOW_SETTING.get(s).toArray(new String[0])));
|
||||
}, Function.identity(), true, Setting.Scope.CLUSTER);
|
||||
}, Function.identity(), Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
public static final Setting<List<String>> HTTP_FILTER_DENY_SETTING = Setting.listSetting("shield.http.filter.deny", (s) -> {
|
||||
return Arrays.asList(s.getAsArray("transport.profiles.default.shield.filter.deny",
|
||||
TRANSPORT_FILTER_DENY_SETTING.get(s).toArray(new String[0])));
|
||||
}, Function.identity(), true, Setting.Scope.CLUSTER);
|
||||
}, Function.identity(), Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
|
||||
public static final ShieldIpFilterRule DEFAULT_PROFILE_ACCEPT_ALL = new ShieldIpFilterRule(true, "default:accept_all") {
|
||||
|
|
|
@ -71,10 +71,10 @@ public class SettingsFilterTests extends ShieldIntegTestCase {
|
|||
}
|
||||
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(Setting.simpleString("foo.bar", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("foo.baz", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("bar.baz", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("baz.foo", false, Setting.Scope.CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("foo.bar", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("foo.baz", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("bar.baz", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("baz.foo", Setting.Property.NodeScope));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class AuditTrailModuleTests extends ESTestCase {
|
|||
.put("shield.audit.enabled", false)
|
||||
.build();
|
||||
SettingsModule settingsModule = new SettingsModule(settings);
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, Setting.Property.NodeScope));
|
||||
Injector injector = Guice.createInjector(settingsModule, new AuditTrailModule(settings));
|
||||
AuditTrail auditTrail = injector.getInstance(AuditTrail.class);
|
||||
assertThat(auditTrail, is(AuditTrail.NOOP));
|
||||
|
@ -57,7 +57,7 @@ public class AuditTrailModuleTests extends ESTestCase {
|
|||
ThreadPool pool = new ThreadPool("testLogFile");
|
||||
try {
|
||||
SettingsModule settingsModule = new SettingsModule(settings);
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, Setting.Property.NodeScope));
|
||||
Injector injector = Guice.createInjector(
|
||||
settingsModule,
|
||||
new NetworkModule(new NetworkService(settings), settings, false, null) {
|
||||
|
@ -89,8 +89,8 @@ public class AuditTrailModuleTests extends ESTestCase {
|
|||
.put("client.type", "node")
|
||||
.build();
|
||||
SettingsModule settingsModule = new SettingsModule(settings);
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.audit.outputs", false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.boolSetting("shield.audit.enabled", true, Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.simpleString("shield.audit.outputs", Setting.Property.NodeScope));
|
||||
try {
|
||||
Guice.createInjector(settingsModule, new AuditTrailModule(settings));
|
||||
fail("Expect initialization to fail when an unknown audit trail output is configured");
|
||||
|
|
|
@ -134,7 +134,7 @@ public class XPackPlugin extends Plugin {
|
|||
public void onModule(SettingsModule module) {
|
||||
|
||||
// we add the `xpack.version` setting to all internal indices
|
||||
module.registerSetting(Setting.simpleString("index.xpack.version", false, Setting.Scope.INDEX));
|
||||
module.registerSetting(Setting.simpleString("index.xpack.version", Setting.Property.IndexScope));
|
||||
|
||||
shield.onModule(module);
|
||||
marvel.onModule(module);
|
||||
|
@ -217,8 +217,8 @@ public class XPackPlugin extends Plugin {
|
|||
* {@code "<feature>.enabled": true | false}
|
||||
*/
|
||||
public static void registerFeatureEnabledSettings(SettingsModule settingsModule, String featureName, boolean defaultValue) {
|
||||
settingsModule.registerSetting(Setting.boolSetting(featureEnabledSetting(featureName), defaultValue, false, Setting.Scope.CLUSTER));
|
||||
settingsModule.registerSetting(Setting.boolSetting(featureEnabledSetting(featureName), defaultValue, Setting.Property.NodeScope));
|
||||
settingsModule.registerSetting(Setting.boolSetting(legacyFeatureEnabledSetting(featureName),
|
||||
defaultValue, false, Setting.Scope.CLUSTER));
|
||||
defaultValue, Setting.Property.NodeScope));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static org.elasticsearch.common.settings.Setting.Scope.CLUSTER;
|
||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||
|
||||
public class Watcher {
|
||||
|
@ -102,9 +101,9 @@ public class Watcher {
|
|||
public static final String NAME = "watcher";
|
||||
|
||||
public static final Setting<String> INDEX_WATCHER_VERSION_SETTING =
|
||||
new Setting<>("index.watcher.plugin.version", "", Function.identity(), false, Setting.Scope.INDEX);
|
||||
new Setting<>("index.watcher.plugin.version", "", Function.identity(), Setting.Property.IndexScope);
|
||||
public static final Setting<String> INDEX_WATCHER_TEMPLATE_VERSION_SETTING =
|
||||
new Setting<>("index.watcher.template.version", "", Function.identity(), false, Setting.Scope.INDEX);
|
||||
new Setting<>("index.watcher.template.version", "", Function.identity(), Setting.Property.IndexScope);
|
||||
|
||||
private static final ESLogger logger = Loggers.getLogger(XPackPlugin.class);
|
||||
|
||||
|
@ -191,28 +190,28 @@ public class Watcher {
|
|||
module.registerSetting(InternalPagerDutyService.PAGERDUTY_ACCOUNT_SETTING);
|
||||
module.registerSetting(INDEX_WATCHER_VERSION_SETTING);
|
||||
module.registerSetting(INDEX_WATCHER_TEMPLATE_VERSION_SETTING);
|
||||
module.registerSetting(Setting.intSetting("watcher.execution.scroll.size", 0, false, CLUSTER));
|
||||
module.registerSetting(Setting.intSetting("watcher.watch.scroll.size", 0, false, CLUSTER));
|
||||
module.registerSetting(Setting.boolSetting(XPackPlugin.featureEnabledSetting(Watcher.NAME), true, false, CLUSTER));
|
||||
module.registerSetting(Setting.intSetting("watcher.execution.scroll.size", 0, Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.intSetting("watcher.watch.scroll.size", 0, Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.boolSetting(XPackPlugin.featureEnabledSetting(Watcher.NAME), true, Setting.Property.NodeScope));
|
||||
module.registerSetting(SecretService.Secure.ENCRYPT_SENSITIVE_DATA_SETTING);
|
||||
|
||||
// TODO add real settings for these
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.search.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.bulk.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.index.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.execution.default_throttle_period", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.http.default_read_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.groupSetting("watcher.http.ssl.", false, CLUSTER));
|
||||
module.registerSetting(Setting.groupSetting("watcher.http.proxy.", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.actions.index.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.index.rest.direct_access", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.trigger.schedule.engine", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.input.search.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.transform.search.default_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.trigger.schedule.ticker.tick_interval", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.execution.scroll.timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.start_immediately", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.http.default_connection_timeout", false, CLUSTER));
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.search.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.bulk.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.internal.ops.index.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.execution.default_throttle_period", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.http.default_read_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.groupSetting("watcher.http.ssl.", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.groupSetting("watcher.http.proxy.", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.actions.index.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.index.rest.direct_access", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.trigger.schedule.engine", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.input.search.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.transform.search.default_timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.trigger.schedule.ticker.tick_interval", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.execution.scroll.timeout", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.start_immediately", Setting.Property.NodeScope));
|
||||
module.registerSetting(Setting.simpleString("watcher.http.default_connection_timeout", Setting.Property.NodeScope));
|
||||
|
||||
module.registerSettingsFilter("watcher.actions.email.service.account.*.smtp.password");
|
||||
module.registerSettingsFilter("watcher.actions.slack.service.account.*.url");
|
||||
|
|
|
@ -28,12 +28,12 @@ public class WatcherModule extends AbstractModule {
|
|||
public static final String HISTORY_TEMPLATE_NAME = "watch_history_" + getHistoryIndexTemplateVersion();
|
||||
public static final String TRIGGERED_TEMPLATE_NAME = "triggered_watches";
|
||||
public static final String WATCHES_TEMPLATE_NAME = "watches";
|
||||
public static final Setting<Settings> HISTORY_TEMPLATE_SETTING = Setting.groupSetting("watcher.history.index.", true,
|
||||
Setting.Scope.CLUSTER);
|
||||
public static final Setting<Settings> TRIGGERED_TEMPLATE_SETTING = Setting.groupSetting("watcher.triggered_watches.index.", true,
|
||||
Setting.Scope.CLUSTER);
|
||||
public static final Setting<Settings> WATCHES_TEMPLATE_SETTING = Setting.groupSetting("watcher.watches.index.", true,
|
||||
Setting.Scope.CLUSTER);
|
||||
public static final Setting<Settings> HISTORY_TEMPLATE_SETTING = Setting.groupSetting("watcher.history.index.",
|
||||
Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
public static final Setting<Settings> TRIGGERED_TEMPLATE_SETTING = Setting.groupSetting("watcher.triggered_watches.index.",
|
||||
Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
public static final Setting<Settings> WATCHES_TEMPLATE_SETTING = Setting.groupSetting("watcher.watches.index.",
|
||||
Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
|
||||
public final static TemplateConfig[] TEMPLATE_CONFIGS = new TemplateConfig[]{
|
||||
|
|
|
@ -23,7 +23,7 @@ public class InternalEmailService extends AbstractLifecycleComponent<EmailServic
|
|||
|
||||
private final SecretService secretService;
|
||||
public static final Setting<Settings> EMAIL_ACCOUNT_SETTING =
|
||||
Setting.groupSetting("watcher.actions.email.service.", true, Setting.Scope.CLUSTER);
|
||||
Setting.groupSetting("watcher.actions.email.service.", Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
private volatile Accounts accounts;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public class InternalHipChatService extends AbstractLifecycleComponent<HipChatSe
|
|||
private final HttpClient httpClient;
|
||||
private volatile HipChatAccounts accounts;
|
||||
public static final Setting<Settings> HIPCHAT_ACCOUNT_SETTING =
|
||||
Setting.groupSetting("watcher.actions.hipchat.service.", true, Setting.Scope.CLUSTER);
|
||||
Setting.groupSetting("watcher.actions.hipchat.service.", Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
@Inject
|
||||
public InternalHipChatService(Settings settings, HttpClient httpClient, ClusterSettings clusterSettings) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.elasticsearch.watcher.support.http.HttpClient;
|
|||
public class InternalPagerDutyService extends AbstractLifecycleComponent<PagerDutyService> implements PagerDutyService {
|
||||
|
||||
public static final Setting<Settings> PAGERDUTY_ACCOUNT_SETTING =
|
||||
Setting.groupSetting("watcher.actions.pagerduty.service.", true, Setting.Scope.CLUSTER);
|
||||
Setting.groupSetting("watcher.actions.pagerduty.service.", Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
|
||||
private final HttpClient httpClient;
|
||||
private volatile PagerDutyAccounts accounts;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class InternalSlackService extends AbstractLifecycleComponent<SlackServic
|
|||
|
||||
private final HttpClient httpClient;
|
||||
public static final Setting<Settings> SLACK_ACCOUNT_SETTING =
|
||||
Setting.groupSetting("watcher.actions.slack.service.", true, Setting.Scope.CLUSTER);
|
||||
Setting.groupSetting("watcher.actions.slack.service.", Setting.Property.Dynamic, Setting.Property.NodeScope);
|
||||
private volatile SlackAccounts accounts;
|
||||
|
||||
@Inject
|
||||
|
|
|
@ -46,7 +46,7 @@ public interface SecretService {
|
|||
private final CryptoService cryptoService;
|
||||
private final boolean encryptSensitiveData;
|
||||
public static final Setting<Boolean> ENCRYPT_SENSITIVE_DATA_SETTING =
|
||||
Setting.boolSetting("watcher.shield.encrypt_sensitive_data", false, false, Setting.Scope.CLUSTER);
|
||||
Setting.boolSetting("watcher.shield.encrypt_sensitive_data", false, Setting.Property.NodeScope);
|
||||
@Inject
|
||||
public Secure(Settings settings, CryptoService cryptoService) {
|
||||
super(settings);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class WatcherIndexTemplateRegistryTests extends AbstractWatcherIntegratio
|
|||
return "installs a setting this test needs";
|
||||
}
|
||||
|
||||
public static final Setting<String> KEY_1 = new Setting<>("index.key1", "", Function.identity(), false, Setting.Scope.INDEX);
|
||||
public static final Setting<String> KEY_1 = new Setting<>("index.key1", "", Function.identity(), Setting.Property.IndexScope);
|
||||
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(KEY_1);
|
||||
|
|
Loading…
Reference in New Issue