Update after review:

* remove `ClusterScope`
* rename `ClusterSettings` to `NodeSettings`
* rename `SettingsProperty` to `Property`
This commit is contained in:
David Pilato 2016-03-04 16:53:22 +01:00
parent 76719341dc
commit 2bb3846d1f
129 changed files with 733 additions and 799 deletions

View File

@ -33,7 +33,7 @@ import org.elasticsearch.cluster.metadata.MetaDataIndexStateService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool;
@ -48,7 +48,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
private final DestructiveOperations destructiveOperations;
private volatile boolean closeIndexEnabled;
public static final Setting<Boolean> CLUSTER_INDICES_CLOSE_ENABLE_SETTING =
Setting.boolSetting("cluster.indices.close.enable", true, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.boolSetting("cluster.indices.close.enable", true, Property.Dynamic, Property.NodeScope);
@Inject
public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.mapper.MapperService;
@ -41,7 +41,7 @@ import java.util.List;
public final class AutoCreateIndex {
public static final Setting<AutoCreate> AUTO_CREATE_INDEX_SETTING =
new Setting<>("action.auto_create_index", "true", AutoCreate::new, SettingsProperty.ClusterScope);
new Setting<>("action.auto_create_index", "true", AutoCreate::new, Property.NodeScope);
private final boolean dynamicMappingDisabled;
private final IndexNameExpressionResolver resolver;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -35,7 +35,7 @@ public final class DestructiveOperations extends AbstractComponent {
* Setting which controls whether wildcard usage (*, prefix*, _all) is allowed.
*/
public static final Setting<Boolean> REQUIRES_NAME_SETTING =
Setting.boolSetting("action.destructive_requires_name", false, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.boolSetting("action.destructive_requires_name", false, Property.Dynamic, Property.NodeScope);
private volatile boolean destructiveRequiresName;
@Inject

View File

@ -24,7 +24,7 @@ import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
@ -39,7 +39,7 @@ public abstract class TransportMasterNodeReadAction<Request extends MasterNodeRe
extends TransportMasterNodeAction<Request, Response> {
public static final Setting<Boolean> FORCE_LOCAL_SETTING =
Setting.boolSetting("action.master.force_local", false, SettingsProperty.ClusterScope);
Setting.boolSetting("action.master.force_local", false, Property.NodeScope);
private final boolean forceLocal;

View File

@ -20,7 +20,7 @@
package org.elasticsearch.bootstrap;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
public final class BootstrapSettings {
@ -29,13 +29,13 @@ public final class BootstrapSettings {
// TODO: remove this hack when insecure defaults are removed from java
public static final Setting<Boolean> SECURITY_FILTER_BAD_DEFAULTS_SETTING =
Setting.boolSetting("security.manager.filter_bad_defaults", true, SettingsProperty.ClusterScope);
Setting.boolSetting("security.manager.filter_bad_defaults", true, Property.NodeScope);
public static final Setting<Boolean> MLOCKALL_SETTING =
Setting.boolSetting("bootstrap.mlockall", false, SettingsProperty.ClusterScope);
Setting.boolSetting("bootstrap.mlockall", false, Property.NodeScope);
public static final Setting<Boolean> SECCOMP_SETTING =
Setting.boolSetting("bootstrap.seccomp", true, SettingsProperty.ClusterScope);
Setting.boolSetting("bootstrap.seccomp", true, Property.NodeScope);
public static final Setting<Boolean> CTRLHANDLER_SETTING =
Setting.boolSetting("bootstrap.ctrlhandler", true, SettingsProperty.ClusterScope);
Setting.boolSetting("bootstrap.ctrlhandler", true, Property.NodeScope);
}

View File

@ -19,14 +19,13 @@
package org.elasticsearch.cache.recycler;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.lease.Releasable;
import org.elasticsearch.common.recycler.AbstractRecyclerC;
import org.elasticsearch.common.recycler.Recycler;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.util.BigArrays;
@ -45,18 +44,18 @@ import static org.elasticsearch.common.recycler.Recyclers.none;
public class PageCacheRecycler extends AbstractComponent implements Releasable {
public static final Setting<Type> TYPE_SETTING =
new Setting<>("cache.recycler.page.type", Type.CONCURRENT.name(), Type::parse, SettingsProperty.ClusterScope);
new Setting<>("cache.recycler.page.type", Type.CONCURRENT.name(), Type::parse, Property.NodeScope);
public static final Setting<ByteSizeValue> LIMIT_HEAP_SETTING =
Setting.byteSizeSetting("cache.recycler.page.limit.heap", "10%", SettingsProperty.ClusterScope);
Setting.byteSizeSetting("cache.recycler.page.limit.heap", "10%", Property.NodeScope);
public static final Setting<Double> WEIGHT_BYTES_SETTING =
Setting.doubleSetting("cache.recycler.page.weight.bytes", 1d, 0d, SettingsProperty.ClusterScope);
Setting.doubleSetting("cache.recycler.page.weight.bytes", 1d, 0d, Property.NodeScope);
public static final Setting<Double> WEIGHT_LONG_SETTING =
Setting.doubleSetting("cache.recycler.page.weight.longs", 1d, 0d, SettingsProperty.ClusterScope);
Setting.doubleSetting("cache.recycler.page.weight.longs", 1d, 0d, Property.NodeScope);
public static final Setting<Double> WEIGHT_INT_SETTING =
Setting.doubleSetting("cache.recycler.page.weight.ints", 1d, 0d, SettingsProperty.ClusterScope);
Setting.doubleSetting("cache.recycler.page.weight.ints", 1d, 0d, Property.NodeScope);
// object pages are less useful to us so we give them a lower weight by default
public static final Setting<Double> WEIGHT_OBJECTS_SETTING =
Setting.doubleSetting("cache.recycler.page.weight.objects", 0.1d, 0d, SettingsProperty.ClusterScope);
Setting.doubleSetting("cache.recycler.page.weight.objects", 0.1d, 0d, Property.NodeScope);
private final Recycler<byte[]> bytePage;
private final Recycler<int[]> intPage;

View File

@ -19,12 +19,8 @@
package org.elasticsearch.client;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
@ -87,7 +83,7 @@ import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.lease.Releasable;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.Map;
@ -115,7 +111,7 @@ public interface Client extends ElasticsearchClient, Releasable {
default:
throw new IllegalArgumentException("Can't parse [client.type] must be one of [node, transport]");
}
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
/**
* The admin client that can be used to perform administrative operations.

View File

@ -34,7 +34,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.common.unit.TimeValue;
@ -102,13 +102,13 @@ public class TransportClientNodesService extends AbstractComponent {
public static final Setting<TimeValue> CLIENT_TRANSPORT_NODES_SAMPLER_INTERVAL =
Setting.positiveTimeSetting("client.transport.nodes_sampler_interval", timeValueSeconds(5), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("client.transport.nodes_sampler_interval", timeValueSeconds(5), Property.NodeScope);
public static final Setting<TimeValue> CLIENT_TRANSPORT_PING_TIMEOUT =
Setting.positiveTimeSetting("client.transport.ping_timeout", timeValueSeconds(5), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("client.transport.ping_timeout", timeValueSeconds(5), Property.NodeScope);
public static final Setting<Boolean> CLIENT_TRANSPORT_IGNORE_CLUSTER_NAME =
Setting.boolSetting("client.transport.ignore_cluster_name", false, SettingsProperty.ClusterScope);
Setting.boolSetting("client.transport.ignore_cluster_name", false, Property.NodeScope);
public static final Setting<Boolean> CLIENT_TRANSPORT_SNIFF =
Setting.boolSetting("client.transport.sniff", false, SettingsProperty.ClusterScope);
Setting.boolSetting("client.transport.sniff", false, Property.NodeScope);
@Inject
public TransportClientNodesService(Settings settings, ClusterName clusterName, TransportService transportService,

View File

@ -58,7 +58,7 @@ import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.ExtensionPoint;
import org.elasticsearch.gateway.GatewayAllocator;
@ -76,7 +76,7 @@ public class ClusterModule extends AbstractModule {
public static final String EVEN_SHARD_COUNT_ALLOCATOR = "even_shard";
public static final String BALANCED_ALLOCATOR = "balanced"; // default
public static final Setting<String> SHARDS_ALLOCATOR_TYPE_SETTING =
new Setting<>("cluster.routing.allocation.type", BALANCED_ALLOCATOR, Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("cluster.routing.allocation.type", BALANCED_ALLOCATOR, Function.identity(), Property.NodeScope);
public static final List<Class<? extends AllocationDecider>> DEFAULT_ALLOCATION_DECIDERS =
Collections.unmodifiableList(Arrays.asList(
SameShardAllocationDecider.class,

View File

@ -23,7 +23,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.io.IOException;
@ -38,7 +38,7 @@ public class ClusterName implements Streamable {
throw new IllegalArgumentException("[cluster.name] must not be empty");
}
return s;
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
public static final ClusterName DEFAULT = new ClusterName(CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY).intern());

View File

@ -39,7 +39,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
@ -67,10 +67,10 @@ public class InternalClusterInfoService extends AbstractComponent implements Clu
public static final Setting<TimeValue> INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING =
Setting.timeSetting("cluster.info.update.interval", TimeValue.timeValueSeconds(30), TimeValue.timeValueSeconds(10),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<TimeValue> INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING =
Setting.positiveTimeSetting("cluster.info.update.timeout", TimeValue.timeValueSeconds(15),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile TimeValue updateFrequency;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.mapper.MapperService;
@ -44,7 +44,7 @@ public class MappingUpdatedAction extends AbstractComponent {
public static final Setting<TimeValue> INDICES_MAPPING_DYNAMIC_TIMEOUT_SETTING =
Setting.positiveTimeSetting("indices.mapping.dynamic_timeout", TimeValue.timeValueSeconds(30),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private IndicesAdminClient client;
private volatile TimeValue dynamicMappingUpdateTimeout;

View File

@ -20,7 +20,7 @@ package org.elasticsearch.cluster.metadata;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
/**
* This class acts as a functional wrapper around the <tt>index.auto_expand_replicas</tt> setting.
@ -57,7 +57,7 @@ final class AutoExpandReplicas {
}
}
return new AutoExpandReplicas(min, max, true);
}, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
}, Property.Dynamic, Property.IndexScope);
private final int minReplicas;
private final int maxReplicas;

View File

@ -38,7 +38,7 @@ import org.elasticsearch.common.compress.CompressedXContent;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.loader.SettingsLoader;
import org.elasticsearch.common.xcontent.FromXContentBuilder;
@ -154,35 +154,35 @@ public class IndexMetaData implements Diffable<IndexMetaData>, FromXContentBuild
public static final String INDEX_SETTING_PREFIX = "index.";
public static final String SETTING_NUMBER_OF_SHARDS = "index.number_of_shards";
public static final Setting<Integer> INDEX_NUMBER_OF_SHARDS_SETTING =
Setting.intSetting(SETTING_NUMBER_OF_SHARDS, 5, 1, SettingsProperty.IndexScope);
Setting.intSetting(SETTING_NUMBER_OF_SHARDS, 5, 1, Property.IndexScope);
public static final String SETTING_NUMBER_OF_REPLICAS = "index.number_of_replicas";
public static final Setting<Integer> INDEX_NUMBER_OF_REPLICAS_SETTING =
Setting.intSetting(SETTING_NUMBER_OF_REPLICAS, 1, 0, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.intSetting(SETTING_NUMBER_OF_REPLICAS, 1, 0, Property.Dynamic, Property.IndexScope);
public static final String SETTING_SHADOW_REPLICAS = "index.shadow_replicas";
public static final Setting<Boolean> INDEX_SHADOW_REPLICAS_SETTING =
Setting.boolSetting(SETTING_SHADOW_REPLICAS, false, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_SHADOW_REPLICAS, false, Property.IndexScope);
public static final String SETTING_SHARED_FILESYSTEM = "index.shared_filesystem";
public static final Setting<Boolean> INDEX_SHARED_FILESYSTEM_SETTING =
Setting.boolSetting(SETTING_SHARED_FILESYSTEM, false, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_SHARED_FILESYSTEM, false, Property.IndexScope);
public static final String SETTING_AUTO_EXPAND_REPLICAS = "index.auto_expand_replicas";
public static final Setting<AutoExpandReplicas> INDEX_AUTO_EXPAND_REPLICAS_SETTING = AutoExpandReplicas.SETTING;
public static final String SETTING_READ_ONLY = "index.blocks.read_only";
public static final Setting<Boolean> INDEX_READ_ONLY_SETTING =
Setting.boolSetting(SETTING_READ_ONLY, false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_READ_ONLY, false, Property.Dynamic, Property.IndexScope);
public static final String SETTING_BLOCKS_READ = "index.blocks.read";
public static final Setting<Boolean> INDEX_BLOCKS_READ_SETTING =
Setting.boolSetting(SETTING_BLOCKS_READ, false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_BLOCKS_READ, false, Property.Dynamic, Property.IndexScope);
public static final String SETTING_BLOCKS_WRITE = "index.blocks.write";
public static final Setting<Boolean> INDEX_BLOCKS_WRITE_SETTING =
Setting.boolSetting(SETTING_BLOCKS_WRITE, false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_BLOCKS_WRITE, false, Property.Dynamic, Property.IndexScope);
public static final String SETTING_BLOCKS_METADATA = "index.blocks.metadata";
public static final Setting<Boolean> INDEX_BLOCKS_METADATA_SETTING =
Setting.boolSetting(SETTING_BLOCKS_METADATA, false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_BLOCKS_METADATA, false, Property.Dynamic, Property.IndexScope);
public static final String SETTING_VERSION_CREATED = "index.version.created";
public static final String SETTING_VERSION_CREATED_STRING = "index.version.created_string";
@ -192,23 +192,23 @@ public class IndexMetaData implements Diffable<IndexMetaData>, FromXContentBuild
public static final String SETTING_CREATION_DATE = "index.creation_date";
public static final String SETTING_PRIORITY = "index.priority";
public static final Setting<Integer> INDEX_PRIORITY_SETTING =
Setting.intSetting("index.priority", 1, 0, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.intSetting("index.priority", 1, 0, Property.Dynamic, Property.IndexScope);
public static final String SETTING_CREATION_DATE_STRING = "index.creation_date_string";
public static final String SETTING_INDEX_UUID = "index.uuid";
public static final String SETTING_DATA_PATH = "index.data_path";
public static final Setting<String> INDEX_DATA_PATH_SETTING =
new Setting<>(SETTING_DATA_PATH, "", Function.identity(), SettingsProperty.IndexScope);
new Setting<>(SETTING_DATA_PATH, "", Function.identity(), Property.IndexScope);
public static final String SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE = "index.shared_filesystem.recover_on_any_node";
public static final Setting<Boolean> INDEX_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE_SETTING =
Setting.boolSetting(SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false, Property.Dynamic, Property.IndexScope);
public static final String INDEX_UUID_NA_VALUE = "_na_";
public static final Setting<Settings> INDEX_ROUTING_REQUIRE_GROUP_SETTING =
Setting.groupSetting("index.routing.allocation.require.", SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.groupSetting("index.routing.allocation.require.", Property.Dynamic, Property.IndexScope);
public static final Setting<Settings> INDEX_ROUTING_INCLUDE_GROUP_SETTING =
Setting.groupSetting("index.routing.allocation.include.", SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.groupSetting("index.routing.allocation.include.", Property.Dynamic, Property.IndexScope);
public static final Setting<Settings> INDEX_ROUTING_EXCLUDE_GROUP_SETTING =
Setting.groupSetting("index.routing.allocation.exclude.", SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.groupSetting("index.routing.allocation.exclude.", Property.Dynamic, Property.IndexScope);
public static final IndexMetaData PROTO = IndexMetaData.builder("")
.settings(Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT))

View File

@ -41,7 +41,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.loader.SettingsLoader;
import org.elasticsearch.common.xcontent.FromXContentBuilder;
@ -141,7 +141,7 @@ public class MetaData implements Iterable<IndexMetaData>, Diffable<MetaData>, Fr
public static final Setting<Boolean> SETTING_READ_ONLY_SETTING =
Setting.boolSetting("cluster.blocks.read_only", false, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.boolSetting("cluster.blocks.read_only", false, Property.Dynamic, Property.NodeScope);
public static final ClusterBlock CLUSTER_READ_ONLY_BLOCK = new ClusterBlock(6, "cluster read-only (api)", false, false, RestStatus.FORBIDDEN, EnumSet.of(ClusterBlockLevel.WRITE, ClusterBlockLevel.METADATA_WRITE));

View File

@ -29,7 +29,7 @@ import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.joda.FormatDateTimeFormatter;
import org.elasticsearch.common.joda.Joda;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.ToXContent;
@ -46,8 +46,8 @@ public class UnassignedInfo implements ToXContent, Writeable<UnassignedInfo> {
private static final TimeValue DEFAULT_DELAYED_NODE_LEFT_TIMEOUT = TimeValue.timeValueMinutes(1);
public static final Setting<TimeValue> INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING =
Setting.timeSetting("index.unassigned.node_left.delayed_timeout", DEFAULT_DELAYED_NODE_LEFT_TIMEOUT, SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
Setting.timeSetting("index.unassigned.node_left.delayed_timeout", DEFAULT_DELAYED_NODE_LEFT_TIMEOUT, Property.Dynamic,
Property.IndexScope);
/**
* Reason why the shard is in unassigned state.

View File

@ -39,7 +39,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.gateway.PriorityComparator;
@ -74,12 +74,12 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING;
public class BalancedShardsAllocator extends AbstractComponent implements ShardsAllocator {
public static final Setting<Float> INDEX_BALANCE_FACTOR_SETTING =
Setting.floatSetting("cluster.routing.allocation.balance.index", 0.55f, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.floatSetting("cluster.routing.allocation.balance.index", 0.55f, Property.Dynamic, Property.NodeScope);
public static final Setting<Float> SHARD_BALANCE_FACTOR_SETTING =
Setting.floatSetting("cluster.routing.allocation.balance.shard", 0.45f, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.floatSetting("cluster.routing.allocation.balance.shard", 0.45f, Property.Dynamic, Property.NodeScope);
public static final Setting<Float> THRESHOLD_SETTING =
Setting.floatSetting("cluster.routing.allocation.balance.threshold", 1.0f, 0.0f,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile WeightFunction weightFunction;
private volatile float threshold;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.HashMap;
@ -79,10 +79,10 @@ public class AwarenessAllocationDecider extends AllocationDecider {
public static final String NAME = "awareness";
public static final Setting<String[]> CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING =
new Setting<>("cluster.routing.allocation.awareness.attributes", "", Strings::splitStringByCommaToArray , SettingsProperty.Dynamic,
SettingsProperty.ClusterScope);
new Setting<>("cluster.routing.allocation.awareness.attributes", "", Strings::splitStringByCommaToArray , Property.Dynamic,
Property.NodeScope);
public static final Setting<Settings> CLUSTER_ROUTING_ALLOCATION_AWARENESS_FORCE_GROUP_SETTING =
Setting.groupSetting("cluster.routing.allocation.awareness.force.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.groupSetting("cluster.routing.allocation.awareness.force.", Property.Dynamic, Property.NodeScope);
private String[] awarenessAttributes;

View File

@ -24,7 +24,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.Locale;
@ -51,7 +51,7 @@ public class ClusterRebalanceAllocationDecider extends AllocationDecider {
public static final String NAME = "cluster_rebalance";
public static final Setting<ClusterRebalanceType> CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING =
new Setting<>("cluster.routing.allocation.allow_rebalance", ClusterRebalanceType.INDICES_ALL_ACTIVE.name().toLowerCase(Locale.ROOT),
ClusterRebalanceType::parseString, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
ClusterRebalanceType::parseString, Property.Dynamic, Property.NodeScope);
/**
* An enum representation for the configured re-balance type.

View File

@ -24,7 +24,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -45,7 +45,7 @@ public class ConcurrentRebalanceAllocationDecider extends AllocationDecider {
public static final Setting<Integer> CLUSTER_ROUTING_ALLOCATION_CLUSTER_CONCURRENT_REBALANCE_SETTING =
Setting.intSetting("cluster.routing.allocation.cluster_concurrent_rebalance", 2, -1,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile int clusterConcurrentRebalance;
@Inject

View File

@ -38,7 +38,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.RatioValue;
@ -83,21 +83,21 @@ public class DiskThresholdDecider extends AllocationDecider {
private volatile TimeValue rerouteInterval;
public static final Setting<Boolean> CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING =
Setting.boolSetting("cluster.routing.allocation.disk.threshold_enabled", true, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.boolSetting("cluster.routing.allocation.disk.threshold_enabled", true, Property.Dynamic, Property.NodeScope);
public static final Setting<String> CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING =
new Setting<>("cluster.routing.allocation.disk.watermark.low", "85%",
(s) -> validWatermarkSetting(s, "cluster.routing.allocation.disk.watermark.low"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<String> CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING =
new Setting<>("cluster.routing.allocation.disk.watermark.high", "90%",
(s) -> validWatermarkSetting(s, "cluster.routing.allocation.disk.watermark.high"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Boolean> CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING =
Setting.boolSetting("cluster.routing.allocation.disk.include_relocations", true,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);;
Property.Dynamic, Property.NodeScope);;
public static final Setting<TimeValue> CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING =
Setting.positiveTimeSetting("cluster.routing.allocation.disk.reroute_interval", TimeValue.timeValueSeconds(60),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/**
* Listens for a node to go over the high watermark and kicks off an empty

View File

@ -26,7 +26,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.Locale;
@ -63,17 +63,17 @@ public class EnableAllocationDecider extends AllocationDecider {
public static final Setting<Allocation> CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING =
new Setting<>("cluster.routing.allocation.enable", Allocation.ALL.name(), Allocation::parse,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Allocation> INDEX_ROUTING_ALLOCATION_ENABLE_SETTING =
new Setting<>("index.routing.allocation.enable", Allocation.ALL.name(), Allocation::parse,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Rebalance> CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING =
new Setting<>("cluster.routing.rebalance.enable", Rebalance.ALL.name(), Rebalance::parse,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Rebalance> INDEX_ROUTING_REBALANCE_ENABLE_SETTING =
new Setting<>("index.routing.rebalance.enable", Rebalance.ALL.name(), Rebalance::parse,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
private volatile Rebalance enableRebalance;
private volatile Allocation enableAllocation;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import static org.elasticsearch.cluster.node.DiscoveryNodeFilters.OpType.AND;
@ -62,11 +62,11 @@ public class FilterAllocationDecider extends AllocationDecider {
public static final String NAME = "filter";
public static final Setting<Settings> CLUSTER_ROUTING_REQUIRE_GROUP_SETTING =
Setting.groupSetting("cluster.routing.allocation.require.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.groupSetting("cluster.routing.allocation.require.", Property.Dynamic, Property.NodeScope);
public static final Setting<Settings> CLUSTER_ROUTING_INCLUDE_GROUP_SETTING =
Setting.groupSetting("cluster.routing.allocation.include.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.groupSetting("cluster.routing.allocation.include.", Property.Dynamic, Property.NodeScope);
public static final Setting<Settings> CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING =
Setting.groupSetting("cluster.routing.allocation.exclude.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.groupSetting("cluster.routing.allocation.exclude.", Property.Dynamic, Property.NodeScope);
private volatile DiscoveryNodeFilters clusterRequireFilters;
private volatile DiscoveryNodeFilters clusterIncludeFilters;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -62,7 +62,7 @@ public class ShardsLimitAllocationDecider extends AllocationDecider {
*/
public static final Setting<Integer> INDEX_TOTAL_SHARDS_PER_NODE_SETTING =
Setting.intSetting("index.routing.allocation.total_shards_per_node", -1, -1,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
/**
* Controls the maximum number of shards per node on a global level.
@ -70,7 +70,7 @@ public class ShardsLimitAllocationDecider extends AllocationDecider {
*/
public static final Setting<Integer> CLUSTER_TOTAL_SHARDS_PER_NODE_SETTING =
Setting.intSetting("cluster.routing.allocation.total_shards_per_node", -1, -1,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
@Inject

View File

@ -26,7 +26,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -42,7 +42,7 @@ public class SnapshotInProgressAllocationDecider extends AllocationDecider {
*/
public static final Setting<Boolean> CLUSTER_ROUTING_ALLOCATION_SNAPSHOT_RELOCATION_ENABLED_SETTING =
Setting.boolSetting("cluster.routing.allocation.snapshot.relocation_enabled", false,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile boolean enableRelocation = false;

View File

@ -25,7 +25,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -55,21 +55,21 @@ public class ThrottlingAllocationDecider extends AllocationDecider {
new Setting<>("cluster.routing.allocation.node_concurrent_recoveries",
Integer.toString(DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES),
(s) -> Setting.parseInt(s, 0, "cluster.routing.allocation.node_concurrent_recoveries"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Integer> CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES_SETTING =
Setting.intSetting("cluster.routing.allocation.node_initial_primaries_recoveries",
DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES, 0,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Integer> CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING =
new Setting<>("cluster.routing.allocation.node_concurrent_incoming_recoveries",
(s) -> CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES_SETTING.getRaw(s),
(s) -> Setting.parseInt(s, 0, "cluster.routing.allocation.node_concurrent_incoming_recoveries"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Integer> CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING =
new Setting<>("cluster.routing.allocation.node_concurrent_outgoing_recoveries",
(s) -> CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES_SETTING.getRaw(s),
(s) -> Setting.parseInt(s, 0, "cluster.routing.allocation.node_concurrent_outgoing_recoveries"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile int primariesInitialRecoveries;

View File

@ -52,7 +52,7 @@ import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.common.transport.TransportAddress;
@ -99,14 +99,14 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
public static final Setting<TimeValue> CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING =
Setting.positiveTimeSetting("cluster.service.slow_task_logging_threshold", TimeValue.timeValueSeconds(30),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<TimeValue> CLUSTER_SERVICE_RECONNECT_INTERVAL_SETTING =
Setting.positiveTimeSetting("cluster.service.reconnect_interval", TimeValue.timeValueSeconds(10), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("cluster.service.reconnect_interval", TimeValue.timeValueSeconds(10), Property.NodeScope);
public static final String UPDATE_THREAD_NAME = "clusterService#updateTask";
public static final Setting<Long> NODE_ID_SEED_SETTING =
// don't use node.id.seed so it won't be seen as an attribute
Setting.longSetting("node_id.seed", 0L, Long.MIN_VALUE, SettingsProperty.ClusterScope);
Setting.longSetting("node_id.seed", 0L, Long.MIN_VALUE, Property.NodeScope);
private final ThreadPool threadPool;
private BiConsumer<ClusterChangedEvent, Discovery.AckListener> clusterStatePublisher;

View File

@ -21,8 +21,7 @@ package org.elasticsearch.common.logging;
import org.apache.log4j.Logger;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Setting.Property;
import java.util.Locale;
@ -32,10 +31,10 @@ import java.util.Locale;
public abstract class ESLoggerFactory {
public static final Setting<LogLevel> LOG_DEFAULT_LEVEL_SETTING =
new Setting<>("logger.level", LogLevel.INFO.name(), LogLevel::parse, SettingsProperty.ClusterScope);
new Setting<>("logger.level", LogLevel.INFO.name(), LogLevel::parse, Property.NodeScope);
public static final Setting<LogLevel> LOG_LEVEL_SETTING =
Setting.prefixKeySetting("logger.", LogLevel.INFO.name(), LogLevel::parse,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static ESLogger getLogger(String prefix, String name) {
prefix = prefix == null ? null : prefix.intern();

View File

@ -28,7 +28,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.ExtensionPoint;
import org.elasticsearch.http.HttpServer;
@ -155,11 +155,11 @@ public class NetworkModule extends AbstractModule {
public static final String LOCAL_TRANSPORT = "local";
public static final String NETTY_TRANSPORT = "netty";
public static final Setting<String> HTTP_TYPE_SETTING = Setting.simpleString("http.type", SettingsProperty.ClusterScope);
public static final Setting<Boolean> HTTP_ENABLED = Setting.boolSetting("http.enabled", true, SettingsProperty.ClusterScope);
public static final Setting<String> HTTP_TYPE_SETTING = Setting.simpleString("http.type", Property.NodeScope);
public static final Setting<Boolean> HTTP_ENABLED = Setting.boolSetting("http.enabled", true, Property.NodeScope);
public static final Setting<String> TRANSPORT_SERVICE_TYPE_SETTING =
Setting.simpleString("transport.service.type", SettingsProperty.ClusterScope);
public static final Setting<String> TRANSPORT_TYPE_SETTING = Setting.simpleString("transport.type", SettingsProperty.ClusterScope);
Setting.simpleString("transport.service.type", Property.NodeScope);
public static final Setting<String> TRANSPORT_TYPE_SETTING = Setting.simpleString("transport.type", Property.NodeScope);

View File

@ -22,7 +22,7 @@ package org.elasticsearch.common.network;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
@ -46,32 +46,32 @@ public class NetworkService extends AbstractComponent {
public static final String DEFAULT_NETWORK_HOST = "_local_";
public static final Setting<List<String>> GLOBAL_NETWORK_HOST_SETTING =
Setting.listSetting("network.host", Arrays.asList(DEFAULT_NETWORK_HOST), Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("network.host", Arrays.asList(DEFAULT_NETWORK_HOST), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> GLOBAL_NETWORK_BINDHOST_SETTING =
Setting.listSetting("network.bind_host", GLOBAL_NETWORK_HOST_SETTING, Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("network.bind_host", GLOBAL_NETWORK_HOST_SETTING, Function.identity(), Property.NodeScope);
public static final Setting<List<String>> GLOBAL_NETWORK_PUBLISHHOST_SETTING =
Setting.listSetting("network.publish_host", GLOBAL_NETWORK_HOST_SETTING, Function.identity(), SettingsProperty.ClusterScope);
public static final Setting<Boolean> NETWORK_SERVER = Setting.boolSetting("network.server", true, SettingsProperty.ClusterScope);
Setting.listSetting("network.publish_host", GLOBAL_NETWORK_HOST_SETTING, Function.identity(), Property.NodeScope);
public static final Setting<Boolean> NETWORK_SERVER = Setting.boolSetting("network.server", true, Property.NodeScope);
public static final class TcpSettings {
public static final Setting<Boolean> TCP_NO_DELAY =
Setting.boolSetting("network.tcp.no_delay", true, SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.no_delay", true, Property.NodeScope);
public static final Setting<Boolean> TCP_KEEP_ALIVE =
Setting.boolSetting("network.tcp.keep_alive", true, SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.keep_alive", true, Property.NodeScope);
public static final Setting<Boolean> TCP_REUSE_ADDRESS =
Setting.boolSetting("network.tcp.reuse_address", NetworkUtils.defaultReuseAddress(), SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.reuse_address", NetworkUtils.defaultReuseAddress(), Property.NodeScope);
public static final Setting<ByteSizeValue> TCP_SEND_BUFFER_SIZE =
Setting.byteSizeSetting("network.tcp.send_buffer_size", new ByteSizeValue(-1), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("network.tcp.send_buffer_size", new ByteSizeValue(-1), Property.NodeScope);
public static final Setting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE =
Setting.byteSizeSetting("network.tcp.receive_buffer_size", new ByteSizeValue(-1), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("network.tcp.receive_buffer_size", new ByteSizeValue(-1), Property.NodeScope);
public static final Setting<Boolean> TCP_BLOCKING =
Setting.boolSetting("network.tcp.blocking", false, SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.blocking", false, Property.NodeScope);
public static final Setting<Boolean> TCP_BLOCKING_SERVER =
Setting.boolSetting("network.tcp.blocking_server", TCP_BLOCKING, SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.blocking_server", TCP_BLOCKING, Property.NodeScope);
public static final Setting<Boolean> TCP_BLOCKING_CLIENT =
Setting.boolSetting("network.tcp.blocking_client", TCP_BLOCKING, SettingsProperty.ClusterScope);
Setting.boolSetting("network.tcp.blocking_client", TCP_BLOCKING, Property.NodeScope);
public static final Setting<TimeValue> TCP_CONNECT_TIMEOUT =
Setting.timeSetting("network.tcp.connect_timeout", new TimeValue(30, TimeUnit.SECONDS), SettingsProperty.ClusterScope);
Setting.timeSetting("network.tcp.connect_timeout", new TimeValue(30, TimeUnit.SECONDS), Property.NodeScope);
}
/**

View File

@ -44,11 +44,11 @@ public abstract class AbstractScopedSettings extends AbstractComponent {
private final List<SettingUpdater<?>> settingUpdaters = new CopyOnWriteArrayList<>();
private final Map<String, Setting<?>> complexMatchers;
private final Map<String, Setting<?>> keySettings;
private final Setting.SettingsProperty scope;
private final Setting.Property scope;
private static final Pattern KEY_PATTERN = Pattern.compile("^(?:[-\\w]+[.])*[-\\w]+$");
private static final Pattern GROUP_KEY_PATTERN = Pattern.compile("^(?:[-\\w]+[.])+$");
protected AbstractScopedSettings(Settings settings, Set<Setting<?>> settingsSet, Setting.SettingsProperty scope) {
protected AbstractScopedSettings(Settings settings, Set<Setting<?>> settingsSet, Setting.Property scope) {
super(settings);
this.lastSettingsApplied = Settings.EMPTY;
this.scope = scope;
@ -96,7 +96,7 @@ public abstract class AbstractScopedSettings extends AbstractComponent {
return GROUP_KEY_PATTERN.matcher(key).matches();
}
public Setting.SettingsProperty getScope() {
public Setting.Property getScope() {
return this.scope;
}

View File

@ -45,7 +45,7 @@ import org.elasticsearch.cluster.service.InternalClusterService;
import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.discovery.DiscoveryModule;
@ -102,7 +102,7 @@ import java.util.function.Predicate;
*/
public final class ClusterSettings extends AbstractScopedSettings {
public ClusterSettings(Settings nodeSettings, Set<Setting<?>> settingsSet) {
super(nodeSettings, settingsSet, SettingsProperty.ClusterScope);
super(nodeSettings, settingsSet, Property.NodeScope);
addSettingsUpdater(new LoggingSettingUpdater(nodeSettings));
}

View File

@ -22,7 +22,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.routing.UnassignedInfo;
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.gateway.PrimaryShardAllocator;
import org.elasticsearch.index.IndexModule;
import org.elasticsearch.index.IndexSettings;
@ -50,7 +50,7 @@ import java.util.function.Predicate;
/**
* Encapsulates all valid index level settings.
* @see org.elasticsearch.common.settings.Setting.SettingsProperty#IndexScope
* @see Property#IndexScope
*/
public final class IndexScopedSettings extends AbstractScopedSettings {
@ -135,15 +135,15 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
EngineConfig.INDEX_CODEC_SETTING,
IndexWarmer.INDEX_NORMS_LOADING_SETTING,
// this sucks but we can't really validate all the analyzers/similarity in here
Setting.groupSetting("index.similarity.", SettingsProperty.IndexScope), // this allows similarity settings to be passed
Setting.groupSetting("index.analysis.", SettingsProperty.IndexScope) // this allows analysis settings to be passed
Setting.groupSetting("index.similarity.", Property.IndexScope), // this allows similarity settings to be passed
Setting.groupSetting("index.analysis.", Property.IndexScope) // this allows analysis settings to be passed
)));
public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, IndexScopedSettings.BUILT_IN_INDEX_SETTINGS);
public IndexScopedSettings(Settings settings, Set<Setting<?>> settingsSet) {
super(settings, settingsSet, SettingsProperty.IndexScope);
super(settings, settingsSet, Property.IndexScope);
}
private IndexScopedSettings(Settings settings, IndexScopedSettings other, IndexMetaData metaData) {

View File

@ -54,7 +54,7 @@ import java.util.stream.Collectors;
* together with {@link AbstractScopedSettings}. This class contains several utility methods that makes it straight forward
* to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this:
* <pre>{@code
* public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, SettingsProperty.ClusterScope);}
* public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, SettingsProperty.NodeScope);}
* </pre>
* To retrieve the value of the setting a {@link Settings} object can be passed directly to the {@link Setting#get(Settings)} method.
* <pre>
@ -66,13 +66,13 @@ import java.util.stream.Collectors;
* RED, GREEN, BLUE;
* }
* public static final Setting<Color> MY_BOOLEAN =
* new Setting<>("my.color.setting", Color.RED.toString(), Color::valueOf, SettingsProperty.ClusterScope);
* new Setting<>("my.color.setting", Color.RED.toString(), Color::valueOf, SettingsProperty.NodeScope);
* }
* </pre>
*/
public class Setting<T> extends ToXContentToBytes {
public enum SettingsProperty {
public enum Property {
/**
* should be filtered in some api (mask password/credentials)
*/
@ -89,25 +89,14 @@ public class Setting<T> extends ToXContentToBytes {
Deprecated,
/**
* Cluster scope.
* @See IndexScope
* @See NodeScope
*/
ClusterScope,
/**
* Node scope.
* @See ClusterScope
* @See IndexScope
* Node scope
*/
NodeScope,
/**
* Index scope.
* @See ClusterScope
* @See NodeScope
* Index scope
*/
IndexScope;
IndexScope
}
private static final ESLogger logger = Loggers.getLogger(Setting.class);
@ -116,31 +105,30 @@ public class Setting<T> extends ToXContentToBytes {
private final Key key;
protected final Function<Settings, String> defaultValue;
private final Function<String, T> parser;
private final EnumSet<SettingsProperty> properties;
private final EnumSet<Property> properties;
/**
* Creates a new Setting instance
* Creates a new Setting instance. When no scope is provided, we default to {@link Property#NodeScope}.
* @param key the settings key for this setting.
* @param defaultValue a default value function that returns the default values string representation.
* @param parser a parser that parses the string rep into a complex datatype.
* @param properties properties for this setting like scope, filtering...
*/
public Setting(Key key, Function<Settings, String> defaultValue, Function<String, T> parser, SettingsProperty... properties) {
public Setting(Key key, Function<Settings, String> defaultValue, Function<String, T> parser, Property... properties) {
assert parser.apply(defaultValue.apply(Settings.EMPTY)) != null || this.isGroupSetting(): "parser returned null";
this.key = key;
this.defaultValue = defaultValue;
this.parser = parser;
if (properties.length == 0) {
this.properties = EnumSet.of(SettingsProperty.NodeScope);
this.properties = EnumSet.of(Property.NodeScope);
} else {
this.properties = EnumSet.copyOf(Arrays.asList(properties));
}
// We validate scope settings. They are mutually exclusive
int numScopes = 0;
for (SettingsProperty property : properties) {
if (property == SettingsProperty.ClusterScope ||
property == SettingsProperty.IndexScope ||
property == SettingsProperty.NodeScope) {
for (Property property : properties) {
if (property == Property.NodeScope ||
property == Property.IndexScope) {
numScopes++;
}
}
@ -156,7 +144,7 @@ public class Setting<T> extends ToXContentToBytes {
* @param parser a parser that parses the string rep into a complex datatype.
* @param properties properties for this setting like scope, filtering...
*/
public Setting(String key, String defaultValue, Function<String, T> parser, SettingsProperty... properties) {
public Setting(String key, String defaultValue, Function<String, T> parser, Property... properties) {
this(key, s -> defaultValue, parser, properties);
}
@ -167,7 +155,7 @@ public class Setting<T> extends ToXContentToBytes {
* @param parser a parser that parses the string rep into a complex datatype.
* @param properties properties for this setting like scope, filtering...
*/
public Setting(String key, Function<Settings, String> defaultValue, Function<String, T> parser, SettingsProperty... properties) {
public Setting(String key, Function<Settings, String> defaultValue, Function<String, T> parser, Property... properties) {
this(new SimpleKey(key), defaultValue, parser, properties);
}
@ -178,7 +166,7 @@ public class Setting<T> extends ToXContentToBytes {
* @param parser a parser that parses the string rep into a complex datatype.
* @param properties properties for this setting like scope, filtering...
*/
public Setting(String key, Setting<T> fallBackSetting, Function<String, T> parser, SettingsProperty... properties) {
public Setting(String key, Setting<T> fallBackSetting, Function<String, T> parser, Property... properties) {
this(key, fallBackSetting::getRaw, parser, properties);
}
@ -204,14 +192,14 @@ public class Setting<T> extends ToXContentToBytes {
* Returns <code>true</code> if this setting is dynamically updateable, otherwise <code>false</code>
*/
public final boolean isDynamic() {
return properties.contains(SettingsProperty.Dynamic);
return properties.contains(Property.Dynamic);
}
/**
* Returns the setting properties
* @see SettingsProperty
* @see Property
*/
public EnumSet<SettingsProperty> getProperties() {
public EnumSet<Property> getProperties() {
return properties;
}
@ -219,35 +207,28 @@ public class Setting<T> extends ToXContentToBytes {
* Returns <code>true</code> if this setting must be filtered, otherwise <code>false</code>
*/
public boolean isFiltered() {
return properties.contains(SettingsProperty.Filtered);
return properties.contains(Property.Filtered);
}
/**
* Returns <code>true</code> if this setting has a cluster scope, otherwise <code>false</code>
* Returns <code>true</code> if this setting has a node scope, otherwise <code>false</code>
*/
public boolean hasClusterScope() {
return properties.contains(SettingsProperty.ClusterScope);
public boolean hasNodeScope() {
return properties.contains(Property.NodeScope);
}
/**
* Returns <code>true</code> if this setting has an index scope, otherwise <code>false</code>
*/
public boolean hasIndexScope() {
return properties.contains(SettingsProperty.IndexScope);
}
/**
* Returns <code>true</code> if this setting has an index scope, otherwise <code>false</code>
*/
public boolean hasNodeScope() {
return properties.contains(SettingsProperty.NodeScope);
return properties.contains(Property.IndexScope);
}
/**
* Returns <code>true</code> if this setting is deprecated, otherwise <code>false</code>
*/
public boolean isDeprecated() {
return properties.contains(SettingsProperty.Deprecated);
return properties.contains(Property.Deprecated);
}
/**
@ -451,11 +432,11 @@ public class Setting<T> extends ToXContentToBytes {
}
public static Setting<Float> floatSetting(String key, float defaultValue, SettingsProperty... properties) {
public static Setting<Float> floatSetting(String key, float defaultValue, Property... properties) {
return new Setting<>(key, (s) -> Float.toString(defaultValue), Float::parseFloat, properties);
}
public static Setting<Float> floatSetting(String key, float defaultValue, float minValue, SettingsProperty... properties) {
public static Setting<Float> floatSetting(String key, float defaultValue, float minValue, Property... properties) {
return new Setting<>(key, (s) -> Float.toString(defaultValue), (s) -> {
float value = Float.parseFloat(s);
if (value < minValue) {
@ -465,19 +446,19 @@ public class Setting<T> extends ToXContentToBytes {
}, properties);
}
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, int maxValue, SettingsProperty... properties) {
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, int maxValue, Property... properties) {
return new Setting<>(key, (s) -> Integer.toString(defaultValue), (s) -> parseInt(s, minValue, maxValue, key), properties);
}
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, SettingsProperty... properties) {
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, Property... properties) {
return new Setting<>(key, (s) -> Integer.toString(defaultValue), (s) -> parseInt(s, minValue, key), properties);
}
public static Setting<Long> longSetting(String key, long defaultValue, long minValue, SettingsProperty... properties) {
public static Setting<Long> longSetting(String key, long defaultValue, long minValue, Property... properties) {
return new Setting<>(key, (s) -> Long.toString(defaultValue), (s) -> parseLong(s, minValue, key), properties);
}
public static Setting<String> simpleString(String key, SettingsProperty... properties) {
public static Setting<String> simpleString(String key, Property... properties) {
return new Setting<>(key, s -> "", Function.identity(), properties);
}
@ -512,52 +493,52 @@ public class Setting<T> extends ToXContentToBytes {
return timeValue;
}
public static Setting<Integer> intSetting(String key, int defaultValue, SettingsProperty... properties) {
public static Setting<Integer> intSetting(String key, int defaultValue, Property... properties) {
return intSetting(key, defaultValue, Integer.MIN_VALUE, properties);
}
public static Setting<Boolean> boolSetting(String key, boolean defaultValue, SettingsProperty... properties) {
public static Setting<Boolean> boolSetting(String key, boolean defaultValue, Property... properties) {
return new Setting<>(key, (s) -> Boolean.toString(defaultValue), Booleans::parseBooleanExact, properties);
}
public static Setting<Boolean> boolSetting(String key, Setting<Boolean> fallbackSetting, SettingsProperty... properties) {
public static Setting<Boolean> boolSetting(String key, Setting<Boolean> fallbackSetting, Property... properties) {
return new Setting<>(key, fallbackSetting, Booleans::parseBooleanExact, properties);
}
public static Setting<ByteSizeValue> byteSizeSetting(String key, String percentage, SettingsProperty... properties) {
public static Setting<ByteSizeValue> byteSizeSetting(String key, String percentage, Property... properties) {
return new Setting<>(key, (s) -> percentage, (s) -> MemorySizeValue.parseBytesSizeValueOrHeapRatio(s, key), properties);
}
public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue value, SettingsProperty... properties) {
public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue value, Property... properties) {
return byteSizeSetting(key, (s) -> value.toString(), properties);
}
public static Setting<ByteSizeValue> byteSizeSetting(String key, Setting<ByteSizeValue> fallbackSettings,
SettingsProperty... properties) {
Property... properties) {
return byteSizeSetting(key, fallbackSettings::getRaw, properties);
}
public static Setting<ByteSizeValue> byteSizeSetting(String key, Function<Settings, String> defaultValue,
SettingsProperty... properties) {
Property... properties) {
return new Setting<>(key, defaultValue, (s) -> ByteSizeValue.parseBytesSizeValue(s, key), properties);
}
public static Setting<TimeValue> positiveTimeSetting(String key, TimeValue defaultValue, SettingsProperty... properties) {
public static Setting<TimeValue> positiveTimeSetting(String key, TimeValue defaultValue, Property... properties) {
return timeSetting(key, defaultValue, TimeValue.timeValueMillis(0), properties);
}
public static <T> Setting<List<T>> listSetting(String key, List<String> defaultStringValue, Function<String, T> singleValueParser,
SettingsProperty... properties) {
Property... properties) {
return listSetting(key, (s) -> defaultStringValue, singleValueParser, properties);
}
public static <T> Setting<List<T>> listSetting(String key, Setting<List<T>> fallbackSetting, Function<String, T> singleValueParser,
SettingsProperty... properties) {
Property... properties) {
return listSetting(key, (s) -> parseableStringToList(fallbackSetting.getRaw(s)), singleValueParser, properties);
}
public static <T> Setting<List<T>> listSetting(String key, Function<Settings, List<String>> defaultStringValue,
Function<String, T> singleValueParser, SettingsProperty... properties) {
Function<String, T> singleValueParser, Property... properties) {
Function<String, List<T>> parser = (s) ->
parseableStringToList(s).stream().map(singleValueParser).collect(Collectors.toList());
@ -611,7 +592,7 @@ public class Setting<T> extends ToXContentToBytes {
}
}
public static Setting<Settings> groupSetting(String key, SettingsProperty... properties) {
public static Setting<Settings> groupSetting(String key, Property... properties) {
// TODO CHECK IF WE REMOVE
if (key.endsWith(".") == false) {
throw new IllegalArgumentException("key must end with a '.'");
@ -671,7 +652,7 @@ public class Setting<T> extends ToXContentToBytes {
}
public static Setting<TimeValue> timeSetting(String key, Function<Settings, String> defaultValue, TimeValue minValue,
SettingsProperty... properties) {
Property... properties) {
return new Setting<>(key, defaultValue, (s) -> {
TimeValue timeValue = TimeValue.parseTimeValue(s, null, key);
if (timeValue.millis() < minValue.millis()) {
@ -681,19 +662,19 @@ public class Setting<T> extends ToXContentToBytes {
}, properties);
}
public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, TimeValue minValue, SettingsProperty... properties) {
public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, TimeValue minValue, Property... properties) {
return timeSetting(key, (s) -> defaultValue.getStringRep(), minValue, properties);
}
public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, SettingsProperty... properties) {
public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, Property... properties) {
return new Setting<>(key, (s) -> defaultValue.toString(), (s) -> TimeValue.parseTimeValue(s, key), properties);
}
public static Setting<TimeValue> timeSetting(String key, Setting<TimeValue> fallbackSetting, SettingsProperty... properties) {
public static Setting<TimeValue> timeSetting(String key, Setting<TimeValue> fallbackSetting, Property... properties) {
return new Setting<>(key, fallbackSetting::getRaw, (s) -> TimeValue.parseTimeValue(s, key), properties);
}
public static Setting<Double> doubleSetting(String key, double defaultValue, double minValue, SettingsProperty... properties) {
public static Setting<Double> doubleSetting(String key, double defaultValue, double minValue, Property... properties) {
return new Setting<>(key, (s) -> Double.toString(defaultValue), (s) -> {
final double d = Double.parseDouble(s);
if (d < minValue) {
@ -722,7 +703,7 @@ public class Setting<T> extends ToXContentToBytes {
* {@link #getConcreteSetting(String)} is used to pull the updater.
*/
public static <T> Setting<T> prefixKeySetting(String prefix, String defaultValue, Function<String, T> parser,
SettingsProperty... properties) {
Property... properties) {
return affixKeySetting(AffixKey.withPrefix(prefix), (s) -> defaultValue, parser, properties);
}
@ -732,17 +713,17 @@ public class Setting<T> extends ToXContentToBytes {
* out of the box unless {@link #getConcreteSetting(String)} is used to pull the updater.
*/
public static <T> Setting<T> adfixKeySetting(String prefix, String suffix, Function<Settings, String> defaultValue,
Function<String, T> parser, SettingsProperty... properties) {
Function<String, T> parser, Property... properties) {
return affixKeySetting(AffixKey.withAdfix(prefix, suffix), defaultValue, parser, properties);
}
public static <T> Setting<T> adfixKeySetting(String prefix, String suffix, String defaultValue, Function<String, T> parser,
SettingsProperty... properties) {
Property... properties) {
return adfixKeySetting(prefix, suffix, (s) -> defaultValue, parser, properties);
}
public static <T> Setting<T> affixKeySetting(AffixKey key, Function<Settings, String> defaultValue, Function<String, T> parser,
SettingsProperty... properties) {
Property... properties) {
return new Setting<T>(key, defaultValue, parser, properties) {
@Override

View File

@ -35,7 +35,7 @@ public class SettingsModule extends AbstractModule {
private final Settings settings;
private final Set<String> settingsFilterPattern = new HashSet<>();
private final Map<String, Setting<?>> clusterSettings = new HashMap<>();
private final Map<String, Setting<?>> nodeSettings = new HashMap<>();
private final Map<String, Setting<?>> indexSettings = new HashMap<>();
private static final Predicate<String> TRIBE_CLIENT_NODE_SETTINGS_PREDICATE = (s) -> s.startsWith("tribe.") && TribeService.TRIBE_SETTING_KEYS.contains(s) == false;
@ -52,7 +52,7 @@ public class SettingsModule extends AbstractModule {
@Override
protected void configure() {
final IndexScopedSettings indexScopedSettings = new IndexScopedSettings(settings, new HashSet<>(this.indexSettings.values()));
final ClusterSettings clusterSettings = new ClusterSettings(settings, new HashSet<>(this.clusterSettings.values()));
final ClusterSettings clusterSettings = new ClusterSettings(settings, new HashSet<>(this.nodeSettings.values()));
// by now we are fully configured, lets check node level settings for unregistered index settings
indexScopedSettings.validate(settings.filter(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE));
final Predicate<String> acceptOnlyClusterSettings = TRIBE_CLIENT_NODE_SETTINGS_PREDICATE.or(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE).negate();
@ -76,17 +76,18 @@ public class SettingsModule extends AbstractModule {
registerSettingsFilter(setting.getKey());
}
}
if (setting.hasClusterScope()) {
if (clusterSettings.containsKey(setting.getKey())) {
if (setting.hasNodeScope()) {
if (nodeSettings.containsKey(setting.getKey())) {
throw new IllegalArgumentException("Cannot register setting [" + setting.getKey() + "] twice");
}
clusterSettings.put(setting.getKey(), setting);
}
if (setting.hasIndexScope()) {
nodeSettings.put(setting.getKey(), setting);
} else if (setting.hasIndexScope()) {
if (indexSettings.containsKey(setting.getKey())) {
throw new IllegalArgumentException("Cannot register setting [" + setting.getKey() + "] twice");
}
indexSettings.put(setting.getKey(), setting);
} else {
throw new IllegalArgumentException("No scope found for setting [" + setting.getKey() + "]");
}
}
@ -108,8 +109,8 @@ public class SettingsModule extends AbstractModule {
* Check if a setting has already been registered
*/
public boolean exists(Setting<?> setting) {
if (setting.hasClusterScope()) {
return clusterSettings.containsKey(setting.getKey());
if (setting.hasNodeScope()) {
return nodeSettings.containsKey(setting.getKey());
}
if (setting.hasIndexScope()) {
return indexSettings.containsKey(setting.getKey());

View File

@ -20,7 +20,7 @@
package org.elasticsearch.common.util.concurrent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.Arrays;
@ -43,7 +43,7 @@ public class EsExecutors {
* This is used to adjust thread pools sizes etc. per node.
*/
public static final Setting<Integer> PROCESSORS_SETTING =
Setting.intSetting("processors", Math.min(32, Runtime.getRuntime().availableProcessors()), 1, SettingsProperty.ClusterScope);
Setting.intSetting("processors", Math.min(32, Runtime.getRuntime().availableProcessors()), 1, Property.NodeScope);
/**
* Returns the number of processors available but at most <tt>32</tt>.

View File

@ -19,12 +19,11 @@
package org.elasticsearch.common.util.concurrent;
import org.apache.lucene.util.CloseableThreadLocal;
import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.io.Closeable;
@ -64,7 +63,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public final class ThreadContext implements Closeable, Writeable<ThreadContext.ThreadContextStruct>{
public static final String PREFIX = "request.headers";
public static final Setting<Settings> DEFAULT_HEADERS_SETTING = Setting.groupSetting(PREFIX + ".", SettingsProperty.ClusterScope);
public static final Setting<Settings> DEFAULT_HEADERS_SETTING = Setting.groupSetting(PREFIX + ".", Property.NodeScope);
private final Map<String, String> defaultHeader;
private static final ThreadContextStruct DEFAULT_CONTEXT = new ThreadContextStruct(Collections.emptyMap());
private final ContextThreadLocal threadLocal;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.inject.multibindings.Multibinder;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.ExtensionPoint;
import org.elasticsearch.discovery.local.LocalDiscovery;
@ -48,9 +48,9 @@ public class DiscoveryModule extends AbstractModule {
public static final Setting<String> DISCOVERY_TYPE_SETTING =
new Setting<>("discovery.type", settings -> DiscoveryNode.localNode(settings) ? "local" : "zen", Function.identity(),
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final Setting<String> ZEN_MASTER_SERVICE_TYPE_SETTING =
new Setting<>("discovery.zen.masterservice.type", "zen", Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("discovery.zen.masterservice.type", "zen", Function.identity(), Property.NodeScope);
private final Settings settings;
private final Map<String, List<Class<? extends UnicastHostsProvider>>> unicastHostProviders = new HashMap<>();

View File

@ -24,7 +24,7 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.RestStatus;
@ -45,7 +45,7 @@ public class DiscoverySettings extends AbstractComponent {
**/
public static final Setting<TimeValue> PUBLISH_TIMEOUT_SETTING =
Setting.positiveTimeSetting("discovery.zen.publish_timeout", TimeValue.timeValueSeconds(30),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/**
* sets the timeout for receiving enough acks for a specific cluster state and committing it. failing
@ -54,14 +54,14 @@ public class DiscoverySettings extends AbstractComponent {
public static final Setting<TimeValue> COMMIT_TIMEOUT_SETTING =
new Setting<>("discovery.zen.commit_timeout", (s) -> PUBLISH_TIMEOUT_SETTING.getRaw(s),
(s) -> TimeValue.parseTimeValue(s, TimeValue.timeValueSeconds(30), "discovery.zen.commit_timeout"),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<ClusterBlock> NO_MASTER_BLOCK_SETTING =
new Setting<>("discovery.zen.no_master_block", "write", DiscoverySettings::parseNoMasterBlock,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final Setting<Boolean> PUBLISH_DIFF_ENABLE_SETTING =
Setting.boolSetting("discovery.zen.publish_diff.enable", true, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.publish_diff.enable", true, Property.Dynamic, Property.NodeScope);
public static final Setting<TimeValue> INITIAL_STATE_TIMEOUT_SETTING =
Setting.positiveTimeSetting("discovery.initial_state_timeout", TimeValue.timeValueSeconds(30), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("discovery.initial_state_timeout", TimeValue.timeValueSeconds(30), Property.NodeScope);
private volatile ClusterBlock noMasterBlock;
private volatile TimeValue publishTimeout;

View File

@ -46,7 +46,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.discovery.Discovery;
@ -89,27 +89,27 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implements Discovery, PingContextProvider {
public final static Setting<TimeValue> PING_TIMEOUT_SETTING =
Setting.positiveTimeSetting("discovery.zen.ping_timeout", timeValueSeconds(3), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("discovery.zen.ping_timeout", timeValueSeconds(3), Property.NodeScope);
public final static Setting<TimeValue> JOIN_TIMEOUT_SETTING =
Setting.timeSetting("discovery.zen.join_timeout",
settings -> TimeValue.timeValueMillis(PING_TIMEOUT_SETTING.get(settings).millis() * 20).toString(),
TimeValue.timeValueMillis(0), SettingsProperty.ClusterScope);
TimeValue.timeValueMillis(0), Property.NodeScope);
public final static Setting<Integer> JOIN_RETRY_ATTEMPTS_SETTING =
Setting.intSetting("discovery.zen.join_retry_attempts", 3, 1, SettingsProperty.ClusterScope);
Setting.intSetting("discovery.zen.join_retry_attempts", 3, 1, Property.NodeScope);
public final static Setting<TimeValue> JOIN_RETRY_DELAY_SETTING =
Setting.positiveTimeSetting("discovery.zen.join_retry_delay", TimeValue.timeValueMillis(100), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("discovery.zen.join_retry_delay", TimeValue.timeValueMillis(100), Property.NodeScope);
public final static Setting<Integer> MAX_PINGS_FROM_ANOTHER_MASTER_SETTING =
Setting.intSetting("discovery.zen.max_pings_from_another_master", 3, 1, SettingsProperty.ClusterScope);
Setting.intSetting("discovery.zen.max_pings_from_another_master", 3, 1, Property.NodeScope);
public final static Setting<Boolean> SEND_LEAVE_REQUEST_SETTING =
Setting.boolSetting("discovery.zen.send_leave_request", true, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.send_leave_request", true, Property.NodeScope);
public final static Setting<Boolean> MASTER_ELECTION_FILTER_CLIENT_SETTING =
Setting.boolSetting("discovery.zen.master_election.filter_client", true, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.master_election.filter_client", true, Property.NodeScope);
public final static Setting<TimeValue> MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING =
Setting.timeSetting("discovery.zen.master_election.wait_for_joins_timeout",
settings -> TimeValue.timeValueMillis(JOIN_TIMEOUT_SETTING.get(settings).millis() / 2).toString(), TimeValue.timeValueMillis(0),
SettingsProperty.ClusterScope);
Property.NodeScope);
public final static Setting<Boolean> MASTER_ELECTION_FILTER_DATA_SETTING =
Setting.boolSetting("discovery.zen.master_election.filter_data", false, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.master_election.filter_data", false, Property.NodeScope);
public static final String DISCOVERY_REJOIN_ACTION_NAME = "internal:discovery/zen/rejoin";

View File

@ -26,7 +26,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
@ -42,7 +42,7 @@ import java.util.List;
public class ElectMasterService extends AbstractComponent {
public static final Setting<Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING =
Setting.intSetting("discovery.zen.minimum_master_nodes", -1, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.intSetting("discovery.zen.minimum_master_nodes", -1, Property.Dynamic, Property.NodeScope);
// This is the minimum version a master needs to be on, otherwise it gets ignored
// This is based on the minimum compatible version of the current version this node is on

View File

@ -22,7 +22,7 @@ import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.threadpool.ThreadPool;
@ -38,15 +38,15 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
public abstract class FaultDetection extends AbstractComponent {
public static final Setting<Boolean> CONNECT_ON_NETWORK_DISCONNECT_SETTING =
Setting.boolSetting("discovery.zen.fd.connect_on_network_disconnect", false, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.fd.connect_on_network_disconnect", false, Property.NodeScope);
public static final Setting<TimeValue> PING_INTERVAL_SETTING =
Setting.positiveTimeSetting("discovery.zen.fd.ping_interval", timeValueSeconds(1), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("discovery.zen.fd.ping_interval", timeValueSeconds(1), Property.NodeScope);
public static final Setting<TimeValue> PING_TIMEOUT_SETTING =
Setting.timeSetting("discovery.zen.fd.ping_timeout", timeValueSeconds(30), SettingsProperty.ClusterScope);
Setting.timeSetting("discovery.zen.fd.ping_timeout", timeValueSeconds(30), Property.NodeScope);
public static final Setting<Integer> PING_RETRIES_SETTING =
Setting.intSetting("discovery.zen.fd.ping_retries", 3, SettingsProperty.ClusterScope);
Setting.intSetting("discovery.zen.fd.ping_retries", 3, Property.NodeScope);
public static final Setting<Boolean> REGISTER_CONNECTION_LISTENER_SETTING =
Setting.boolSetting("discovery.zen.fd.register_connection_listener", true, SettingsProperty.ClusterScope);
Setting.boolSetting("discovery.zen.fd.register_connection_listener", true, Property.NodeScope);
protected final ThreadPool threadPool;
protected final ClusterName clusterName;

View File

@ -32,7 +32,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.common.unit.TimeValue;
@ -89,9 +89,9 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
public static final String ACTION_NAME = "internal:discovery/zen/unicast";
public static final Setting<List<String>> DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING =
Setting.listSetting("discovery.zen.ping.unicast.hosts", Collections.emptyList(), Function.identity(),
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final Setting<Integer> DISCOVERY_ZEN_PING_UNICAST_CONCURRENT_CONNECTS_SETTING =
Setting.intSetting("discovery.zen.ping.unicast.concurrent_connects", 10, 0, SettingsProperty.ClusterScope);
Setting.intSetting("discovery.zen.ping.unicast.concurrent_connects", 10, 0, Property.NodeScope);
// these limits are per-address
public static final int LIMIT_FOREIGN_PORTS_COUNT = 1;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.common.io.PathUtils;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.io.IOException;
@ -47,17 +47,17 @@ import static org.elasticsearch.common.Strings.cleanPath;
// TODO: move PathUtils to be package-private here instead of
// public+forbidden api!
public class Environment {
public static final Setting<String> PATH_HOME_SETTING = Setting.simpleString("path.home", SettingsProperty.ClusterScope);
public static final Setting<String> PATH_CONF_SETTING = Setting.simpleString("path.conf", SettingsProperty.ClusterScope);
public static final Setting<String> PATH_SCRIPTS_SETTING = Setting.simpleString("path.scripts", SettingsProperty.ClusterScope);
public static final Setting<String> PATH_HOME_SETTING = Setting.simpleString("path.home", Property.NodeScope);
public static final Setting<String> PATH_CONF_SETTING = Setting.simpleString("path.conf", Property.NodeScope);
public static final Setting<String> PATH_SCRIPTS_SETTING = Setting.simpleString("path.scripts", Property.NodeScope);
public static final Setting<List<String>> PATH_DATA_SETTING =
Setting.listSetting("path.data", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
public static final Setting<String> PATH_LOGS_SETTING = Setting.simpleString("path.logs", SettingsProperty.ClusterScope);
public static final Setting<String> PATH_PLUGINS_SETTING = Setting.simpleString("path.plugins", SettingsProperty.ClusterScope);
Setting.listSetting("path.data", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<String> PATH_LOGS_SETTING = Setting.simpleString("path.logs", Property.NodeScope);
public static final Setting<String> PATH_PLUGINS_SETTING = Setting.simpleString("path.plugins", Property.NodeScope);
public static final Setting<List<String>> PATH_REPO_SETTING =
Setting.listSetting("path.repo", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
public static final Setting<String> PATH_SHARED_DATA_SETTING = Setting.simpleString("path.shared_data", SettingsProperty.ClusterScope);
public static final Setting<String> PIDFILE_SETTING = Setting.simpleString("pidfile", SettingsProperty.ClusterScope);
Setting.listSetting("path.repo", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<String> PATH_SHARED_DATA_SETTING = Setting.simpleString("path.shared_data", Property.NodeScope);
public static final Setting<String> PIDFILE_SETTING = Setting.simpleString("pidfile", Property.NodeScope);
private final Settings settings;

View File

@ -36,7 +36,7 @@ import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.FileSystemUtils;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
@ -49,7 +49,6 @@ import org.elasticsearch.index.store.FsDirectoryService;
import org.elasticsearch.monitor.fs.FsInfo;
import org.elasticsearch.monitor.fs.FsProbe;
import org.elasticsearch.monitor.jvm.JvmInfo;
import org.elasticsearch.monitor.process.ProcessProbe;
import java.io.Closeable;
import java.io.IOException;
@ -138,19 +137,19 @@ public final class NodeEnvironment extends AbstractComponent implements Closeabl
* Maximum number of data nodes that should run in an environment.
*/
public static final Setting<Integer> MAX_LOCAL_STORAGE_NODES_SETTING = Setting.intSetting("node.max_local_storage_nodes", 50, 1,
SettingsProperty.ClusterScope);
Property.NodeScope);
/**
* If true automatically append node id to custom data paths.
*/
public static final Setting<Boolean> ADD_NODE_ID_TO_CUSTOM_PATH =
Setting.boolSetting("node.add_id_to_custom_path", true, SettingsProperty.ClusterScope);
Setting.boolSetting("node.add_id_to_custom_path", true, Property.NodeScope);
/**
* If true the [verbose] SegmentInfos.infoStream logging is sent to System.out.
*/
public static final Setting<Boolean> ENABLE_LUCENE_SEGMENT_INFOS_TRACE_SETTING =
Setting.boolSetting("node.enable_lucene_segment_infos_trace", false, SettingsProperty.ClusterScope);
Setting.boolSetting("node.enable_lucene_segment_infos_trace", false, Property.NodeScope);
public static final String NODES_FOLDER = "nodes";
public static final String INDICES_FOLDER = "indices";
@ -225,7 +224,7 @@ public final class NodeEnvironment extends AbstractComponent implements Closeabl
maybeLogPathDetails();
maybeLogHeapDetails();
applySegmentInfosTrace(settings);
assertCanWrite();
success = true;

View File

@ -37,7 +37,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.discovery.Discovery;
@ -53,19 +53,19 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class GatewayService extends AbstractLifecycleComponent<GatewayService> implements ClusterStateListener {
public static final Setting<Integer> EXPECTED_NODES_SETTING =
Setting.intSetting("gateway.expected_nodes", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.expected_nodes", -1, -1, Property.NodeScope);
public static final Setting<Integer> EXPECTED_DATA_NODES_SETTING =
Setting.intSetting("gateway.expected_data_nodes", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.expected_data_nodes", -1, -1, Property.NodeScope);
public static final Setting<Integer> EXPECTED_MASTER_NODES_SETTING =
Setting.intSetting("gateway.expected_master_nodes", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.expected_master_nodes", -1, -1, Property.NodeScope);
public static final Setting<TimeValue> RECOVER_AFTER_TIME_SETTING =
Setting.positiveTimeSetting("gateway.recover_after_time", TimeValue.timeValueMillis(0), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("gateway.recover_after_time", TimeValue.timeValueMillis(0), Property.NodeScope);
public static final Setting<Integer> RECOVER_AFTER_NODES_SETTING =
Setting.intSetting("gateway.recover_after_nodes", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.recover_after_nodes", -1, -1, Property.NodeScope);
public static final Setting<Integer> RECOVER_AFTER_DATA_NODES_SETTING =
Setting.intSetting("gateway.recover_after_data_nodes", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.recover_after_data_nodes", -1, -1, Property.NodeScope);
public static final Setting<Integer> RECOVER_AFTER_MASTER_NODES_SETTING =
Setting.intSetting("gateway.recover_after_master_nodes", 0, 0, SettingsProperty.ClusterScope);
Setting.intSetting("gateway.recover_after_master_nodes", 0, 0, Property.NodeScope);
public static final ClusterBlock STATE_NOT_RECOVERED_BLOCK = new ClusterBlock(1, "state not recovered / initialized", true, true, RestStatus.SERVICE_UNAVAILABLE, ClusterBlockLevel.ALL);

View File

@ -31,7 +31,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.cluster.routing.allocation.decider.Decision;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.gateway.TransportNodesListGatewayStartedShards.NodeGatewayStartedShards;
import org.elasticsearch.index.shard.ShardStateMetaData;
@ -70,11 +70,11 @@ public abstract class PrimaryShardAllocator extends AbstractComponent {
public static final Setting<String> NODE_INITIAL_SHARDS_SETTING =
new Setting<>("gateway.initial_shards", (settings) -> settings.get("gateway.local.initial_shards", "quorum"), INITIAL_SHARDS_PARSER,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
@Deprecated
public static final Setting<String> INDEX_RECOVERY_INITIAL_SHARDS_SETTING =
new Setting<>("index.recovery.initial_shards", (settings) -> NODE_INITIAL_SHARDS_SETTING.get(settings) , INITIAL_SHARDS_PARSER,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public PrimaryShardAllocator(Settings settings) {
super(settings);

View File

@ -20,7 +20,7 @@
package org.elasticsearch.http;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.transport.PortsRange;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -34,50 +34,50 @@ import static org.elasticsearch.common.settings.Setting.listSetting;
public final class HttpTransportSettings {
public static final Setting<Boolean> SETTING_CORS_ENABLED =
Setting.boolSetting("http.cors.enabled", false, SettingsProperty.ClusterScope);
Setting.boolSetting("http.cors.enabled", false, Property.NodeScope);
public static final Setting<String> SETTING_CORS_ALLOW_ORIGIN =
new Setting<String>("http.cors.allow-origin", "", (value) -> value, SettingsProperty.ClusterScope);
new Setting<String>("http.cors.allow-origin", "", (value) -> value, Property.NodeScope);
public static final Setting<Integer> SETTING_CORS_MAX_AGE =
Setting.intSetting("http.cors.max-age", 1728000, SettingsProperty.ClusterScope);
Setting.intSetting("http.cors.max-age", 1728000, Property.NodeScope);
public static final Setting<String> SETTING_CORS_ALLOW_METHODS =
new Setting<String>("http.cors.allow-methods", "OPTIONS, HEAD, GET, POST, PUT, DELETE", (value) -> value, SettingsProperty.ClusterScope);
new Setting<String>("http.cors.allow-methods", "OPTIONS, HEAD, GET, POST, PUT, DELETE", (value) -> value, Property.NodeScope);
public static final Setting<String> SETTING_CORS_ALLOW_HEADERS =
new Setting<String>("http.cors.allow-headers", "X-Requested-With, Content-Type, Content-Length", (value) -> value, SettingsProperty.ClusterScope);
new Setting<String>("http.cors.allow-headers", "X-Requested-With, Content-Type, Content-Length", (value) -> value, Property.NodeScope);
public static final Setting<Boolean> SETTING_CORS_ALLOW_CREDENTIALS =
Setting.boolSetting("http.cors.allow-credentials", false, SettingsProperty.ClusterScope);
Setting.boolSetting("http.cors.allow-credentials", false, Property.NodeScope);
public static final Setting<Boolean> SETTING_PIPELINING =
Setting.boolSetting("http.pipelining", true, SettingsProperty.ClusterScope);
Setting.boolSetting("http.pipelining", true, Property.NodeScope);
public static final Setting<Integer> SETTING_PIPELINING_MAX_EVENTS =
Setting.intSetting("http.pipelining.max_events", 10000, SettingsProperty.ClusterScope);
Setting.intSetting("http.pipelining.max_events", 10000, Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_COMPRESSION =
Setting.boolSetting("http.compression", false, SettingsProperty.ClusterScope);
Setting.boolSetting("http.compression", false, Property.NodeScope);
public static final Setting<Integer> SETTING_HTTP_COMPRESSION_LEVEL =
Setting.intSetting("http.compression_level", 6, SettingsProperty.ClusterScope);
Setting.intSetting("http.compression_level", 6, Property.NodeScope);
public static final Setting<List<String>> SETTING_HTTP_HOST =
listSetting("http.host", emptyList(), Function.identity(), SettingsProperty.ClusterScope);
listSetting("http.host", emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> SETTING_HTTP_PUBLISH_HOST =
listSetting("http.publish_host", SETTING_HTTP_HOST, Function.identity(), SettingsProperty.ClusterScope);
listSetting("http.publish_host", SETTING_HTTP_HOST, Function.identity(), Property.NodeScope);
public static final Setting<List<String>> SETTING_HTTP_BIND_HOST =
listSetting("http.bind_host", SETTING_HTTP_HOST, Function.identity(), SettingsProperty.ClusterScope);
listSetting("http.bind_host", SETTING_HTTP_HOST, Function.identity(), Property.NodeScope);
public static final Setting<PortsRange> SETTING_HTTP_PORT =
new Setting<PortsRange>("http.port", "9200-9300", PortsRange::new, SettingsProperty.ClusterScope);
new Setting<PortsRange>("http.port", "9200-9300", PortsRange::new, Property.NodeScope);
public static final Setting<Integer> SETTING_HTTP_PUBLISH_PORT =
Setting.intSetting("http.publish_port", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("http.publish_port", -1, -1, Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_DETAILED_ERRORS_ENABLED =
Setting.boolSetting("http.detailed_errors.enabled", true, SettingsProperty.ClusterScope);
Setting.boolSetting("http.detailed_errors.enabled", true, Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_MAX_CONTENT_LENGTH =
Setting.byteSizeSetting("http.max_content_length", new ByteSizeValue(100, ByteSizeUnit.MB), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("http.max_content_length", new ByteSizeValue(100, ByteSizeUnit.MB), Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_MAX_CHUNK_SIZE =
Setting.byteSizeSetting("http.max_chunk_size", new ByteSizeValue(8, ByteSizeUnit.KB), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("http.max_chunk_size", new ByteSizeValue(8, ByteSizeUnit.KB), Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_MAX_HEADER_SIZE =
Setting.byteSizeSetting("http.max_header_size", new ByteSizeValue(8, ByteSizeUnit.KB), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("http.max_header_size", new ByteSizeValue(8, ByteSizeUnit.KB), Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_MAX_INITIAL_LINE_LENGTH =
Setting.byteSizeSetting("http.max_initial_line_length", new ByteSizeValue(4, ByteSizeUnit.KB), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("http.max_initial_line_length", new ByteSizeValue(4, ByteSizeUnit.KB), Property.NodeScope);
// don't reset cookies by default, since I don't think we really need to
// note, parsing cookies was fixed in netty 3.5.1 regarding stack allocation, but still, currently, we don't need cookies
public static final Setting<Boolean> SETTING_HTTP_RESET_COOKIES =
Setting.boolSetting("http.reset_cookies", false, SettingsProperty.ClusterScope);
Setting.boolSetting("http.reset_cookies", false, Property.NodeScope);
private HttpTransportSettings() {
}

View File

@ -29,7 +29,7 @@ import org.elasticsearch.common.netty.OpenChannelsHandler;
import org.elasticsearch.common.network.NetworkAddress;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.BoundTransportAddress;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
@ -120,29 +120,29 @@ public class NettyHttpServerTransport extends AbstractLifecycleComponent<HttpSer
public static Setting<ByteSizeValue> SETTING_HTTP_NETTY_MAX_CUMULATION_BUFFER_CAPACITY =
Setting.byteSizeSetting("http.netty.max_cumulation_buffer_capacity", new ByteSizeValue(-1),
SettingsProperty.ClusterScope);
Property.NodeScope);
public static Setting<Integer> SETTING_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS =
Setting.intSetting("http.netty.max_composite_buffer_components", -1, SettingsProperty.ClusterScope);
Setting.intSetting("http.netty.max_composite_buffer_components", -1, Property.NodeScope);
public static final Setting<Integer> SETTING_HTTP_WORKER_COUNT = new Setting<>("http.netty.worker_count",
(s) -> Integer.toString(EsExecutors.boundedNumberOfProcessors(s) * 2),
(s) -> Setting.parseInt(s, 1, "http.netty.worker_count"), SettingsProperty.ClusterScope);
(s) -> Setting.parseInt(s, 1, "http.netty.worker_count"), Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_TCP_NO_DELAY =
boolSetting("http.tcp_no_delay", NetworkService.TcpSettings.TCP_NO_DELAY, SettingsProperty.ClusterScope);
boolSetting("http.tcp_no_delay", NetworkService.TcpSettings.TCP_NO_DELAY, Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_TCP_KEEP_ALIVE =
boolSetting("http.tcp.keep_alive", NetworkService.TcpSettings.TCP_KEEP_ALIVE, SettingsProperty.ClusterScope);
boolSetting("http.tcp.keep_alive", NetworkService.TcpSettings.TCP_KEEP_ALIVE, Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_TCP_BLOCKING_SERVER =
boolSetting("http.tcp.blocking_server", NetworkService.TcpSettings.TCP_BLOCKING_SERVER, SettingsProperty.ClusterScope);
boolSetting("http.tcp.blocking_server", NetworkService.TcpSettings.TCP_BLOCKING_SERVER, Property.NodeScope);
public static final Setting<Boolean> SETTING_HTTP_TCP_REUSE_ADDRESS =
boolSetting("http.tcp.reuse_address", NetworkService.TcpSettings.TCP_REUSE_ADDRESS, SettingsProperty.ClusterScope);
boolSetting("http.tcp.reuse_address", NetworkService.TcpSettings.TCP_REUSE_ADDRESS, Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_TCP_SEND_BUFFER_SIZE =
Setting.byteSizeSetting("http.tcp.send_buffer_size", NetworkService.TcpSettings.TCP_SEND_BUFFER_SIZE,
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_TCP_RECEIVE_BUFFER_SIZE =
Setting.byteSizeSetting("http.tcp.receive_buffer_size", NetworkService.TcpSettings.TCP_RECEIVE_BUFFER_SIZE,
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_SIZE =
Setting.byteSizeSetting("transport.netty.receive_predictor_size",
settings -> {
@ -154,11 +154,11 @@ public class NettyHttpServerTransport extends AbstractLifecycleComponent<HttpSer
defaultReceiverPredictor = Math.min(defaultReceiverPredictor, Math.max(l, 64 * 1024));
}
return new ByteSizeValue(defaultReceiverPredictor).toString();
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_MIN =
byteSizeSetting("http.netty.receive_predictor_min", SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_SIZE, SettingsProperty.ClusterScope);
byteSizeSetting("http.netty.receive_predictor_min", SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_SIZE, Property.NodeScope);
public static final Setting<ByteSizeValue> SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_MAX =
byteSizeSetting("http.netty.receive_predictor_max", SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_SIZE, SettingsProperty.ClusterScope);
byteSizeSetting("http.netty.receive_predictor_max", SETTING_HTTP_NETTY_RECEIVE_PREDICTOR_SIZE, Property.NodeScope);
protected final NetworkService networkService;

View File

@ -22,7 +22,7 @@ package org.elasticsearch.index;
import org.apache.lucene.util.SetOnce;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.analysis.AnalysisRegistry;
@ -67,15 +67,15 @@ import java.util.function.Function;
public final class IndexModule {
public static final Setting<String> INDEX_STORE_TYPE_SETTING =
new Setting<>("index.store.type", "", Function.identity(), SettingsProperty.IndexScope);
new Setting<>("index.store.type", "", Function.identity(), Property.IndexScope);
public static final String SIMILARITY_SETTINGS_PREFIX = "index.similarity";
public static final String INDEX_QUERY_CACHE = "index";
public static final String NONE_QUERY_CACHE = "none";
public static final Setting<String> INDEX_QUERY_CACHE_TYPE_SETTING =
new Setting<>("index.queries.cache.type", INDEX_QUERY_CACHE, Function.identity(), SettingsProperty.IndexScope);
new Setting<>("index.queries.cache.type", INDEX_QUERY_CACHE, Function.identity(), Property.IndexScope);
// for test purposes only
public static final Setting<Boolean> INDEX_QUERY_CACHE_EVERYTHING_SETTING =
Setting.boolSetting("index.queries.cache.everything", false, SettingsProperty.IndexScope);
Setting.boolSetting("index.queries.cache.everything", false, Property.IndexScope);
private final IndexSettings indexSettings;
private final IndexStoreConfig indexStoreConfig;
private final AnalysisRegistry analysisRegistry;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -51,25 +51,25 @@ import java.util.function.Predicate;
public final class IndexSettings {
public static final Setting<String> DEFAULT_FIELD_SETTING =
new Setting<>("index.query.default_field", AllFieldMapper.NAME, Function.identity(), SettingsProperty.IndexScope);
new Setting<>("index.query.default_field", AllFieldMapper.NAME, Function.identity(), Property.IndexScope);
public static final Setting<Boolean> QUERY_STRING_LENIENT_SETTING =
Setting.boolSetting("index.query_string.lenient", false, SettingsProperty.IndexScope);
Setting.boolSetting("index.query_string.lenient", false, Property.IndexScope);
public static final Setting<Boolean> QUERY_STRING_ANALYZE_WILDCARD =
Setting.boolSetting("indices.query.query_string.analyze_wildcard", false, SettingsProperty.ClusterScope);
Setting.boolSetting("indices.query.query_string.analyze_wildcard", false, Property.NodeScope);
public static final Setting<Boolean> QUERY_STRING_ALLOW_LEADING_WILDCARD =
Setting.boolSetting("indices.query.query_string.allowLeadingWildcard", true, SettingsProperty.ClusterScope);
Setting.boolSetting("indices.query.query_string.allowLeadingWildcard", true, Property.NodeScope);
public static final Setting<Boolean> ALLOW_UNMAPPED =
Setting.boolSetting("index.query.parse.allow_unmapped_fields", true, SettingsProperty.IndexScope);
Setting.boolSetting("index.query.parse.allow_unmapped_fields", true, Property.IndexScope);
public static final Setting<TimeValue> INDEX_TRANSLOG_SYNC_INTERVAL_SETTING =
Setting.timeSetting("index.translog.sync_interval", TimeValue.timeValueSeconds(5), TimeValue.timeValueMillis(100),
SettingsProperty.IndexScope);
Property.IndexScope);
public static final Setting<Translog.Durability> INDEX_TRANSLOG_DURABILITY_SETTING =
new Setting<>("index.translog.durability", Translog.Durability.REQUEST.name(),
(value) -> Translog.Durability.valueOf(value.toUpperCase(Locale.ROOT)), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
(value) -> Translog.Durability.valueOf(value.toUpperCase(Locale.ROOT)), Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_WARMER_ENABLED_SETTING =
Setting.boolSetting("index.warmer.enabled", true, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting("index.warmer.enabled", true, Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_TTL_DISABLE_PURGE_SETTING =
Setting.boolSetting("index.ttl.disable_purge", false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting("index.ttl.disable_purge", false, Property.Dynamic, Property.IndexScope);
public static final Setting<String> INDEX_CHECK_ON_STARTUP = new Setting<>("index.shard.check_on_startup", "false", (s) -> {
switch(s) {
case "false":
@ -80,7 +80,7 @@ public final class IndexSettings {
default:
throw new IllegalArgumentException("unknown value for [index.shard.check_on_startup] must be one of [true, false, fix, checksum] but was: " + s);
}
}, SettingsProperty.IndexScope);
}, Property.IndexScope);
/**
* Index setting describing the maximum value of from + size on a query.
@ -91,14 +91,14 @@ public final class IndexSettings {
* safely.
*/
public static final Setting<Integer> MAX_RESULT_WINDOW_SETTING =
Setting.intSetting("index.max_result_window", 10000, 1, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.intSetting("index.max_result_window", 10000, 1, Property.Dynamic, Property.IndexScope);
public static final TimeValue DEFAULT_REFRESH_INTERVAL = new TimeValue(1, TimeUnit.SECONDS);
public static final Setting<TimeValue> INDEX_REFRESH_INTERVAL_SETTING =
Setting.timeSetting("index.refresh_interval", DEFAULT_REFRESH_INTERVAL, new TimeValue(-1, TimeUnit.MILLISECONDS),
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING =
Setting.byteSizeSetting("index.translog.flush_threshold_size", new ByteSizeValue(512, ByteSizeUnit.MB), SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
Setting.byteSizeSetting("index.translog.flush_threshold_size", new ByteSizeValue(512, ByteSizeUnit.MB), Property.Dynamic,
Property.IndexScope);
/**
@ -107,8 +107,8 @@ public final class IndexSettings {
*/
public static final TimeValue DEFAULT_GC_DELETES = TimeValue.timeValueSeconds(60);
public static final Setting<TimeValue> INDEX_GC_DELETES_SETTING =
Setting.timeSetting("index.gc_deletes", DEFAULT_GC_DELETES, new TimeValue(-1, TimeUnit.MILLISECONDS), SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
Setting.timeSetting("index.gc_deletes", DEFAULT_GC_DELETES, new TimeValue(-1, TimeUnit.MILLISECONDS), Property.Dynamic,
Property.IndexScope);
private final Index index;
private final Version version;

View File

@ -27,7 +27,7 @@ import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.NumericDocValues;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.engine.Engine;
@ -57,7 +57,7 @@ public final class IndexWarmer extends AbstractComponent {
public static final Setting<MappedFieldType.Loading> INDEX_NORMS_LOADING_SETTING = new Setting<>("index.norms.loading",
MappedFieldType.Loading.LAZY.toString(), (s) -> MappedFieldType.Loading.parse(s, MappedFieldType.Loading.LAZY),
SettingsProperty.IndexScope);
Property.IndexScope);
private final List<Listener> listeners;
IndexWarmer(Settings settings, ThreadPool threadPool, Listener... listeners) {

View File

@ -24,7 +24,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.index.engine.Engine;
@ -57,21 +57,21 @@ public final class IndexingSlowLog implements IndexingOperationListener {
private static final String INDEX_INDEXING_SLOWLOG_PREFIX = "index.indexing.slowlog";
public static final Setting<TimeValue> INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_WARN_SETTING =
Setting.timeSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.warn", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_INFO_SETTING =
Setting.timeSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.info", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_DEBUG_SETTING =
Setting.timeSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.debug", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_TRACE_SETTING =
Setting.timeSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.trace", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_INDEXING_SLOWLOG_REFORMAT_SETTING =
Setting.boolSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".reformat", true, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(INDEX_INDEXING_SLOWLOG_PREFIX +".reformat", true, Property.Dynamic, Property.IndexScope);
public static final Setting<SlowLogLevel> INDEX_INDEXING_SLOWLOG_LEVEL_SETTING =
new Setting<>(INDEX_INDEXING_SLOWLOG_PREFIX +".level", SlowLogLevel.TRACE.name(), SlowLogLevel::parse, SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
new Setting<>(INDEX_INDEXING_SLOWLOG_PREFIX +".level", SlowLogLevel.TRACE.name(), SlowLogLevel::parse, Property.Dynamic,
Property.IndexScope);
/**
* Reads how much of the source to log. The user can specify any value they
* like and numbers are interpreted the maximum number of characters to log
@ -84,7 +84,7 @@ public final class IndexingSlowLog implements IndexingOperationListener {
} catch (NumberFormatException e) {
return Booleans.parseBoolean(value, true) ? Integer.MAX_VALUE : 0;
}
}, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
}, Property.Dynamic, Property.IndexScope);
IndexingSlowLog(IndexSettings indexSettings) {
this(indexSettings, Loggers.getLogger(INDEX_INDEXING_SLOWLOG_PREFIX + ".index"),

View File

@ -25,7 +25,7 @@ import org.apache.lucene.index.TieredMergePolicy;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -129,29 +129,29 @@ public final class MergePolicyConfig {
public static final double DEFAULT_RECLAIM_DELETES_WEIGHT = 2.0d;
public static final Setting<Double> INDEX_COMPOUND_FORMAT_SETTING =
new Setting<>("index.compound_format", Double.toString(TieredMergePolicy.DEFAULT_NO_CFS_RATIO), MergePolicyConfig::parseNoCFSRatio,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Double> INDEX_MERGE_POLICY_EXPUNGE_DELETES_ALLOWED_SETTING =
Setting.doubleSetting("index.merge.policy.expunge_deletes_allowed", DEFAULT_EXPUNGE_DELETES_ALLOWED, 0.0d,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDEX_MERGE_POLICY_FLOOR_SEGMENT_SETTING =
Setting.byteSizeSetting("index.merge.policy.floor_segment", DEFAULT_FLOOR_SEGMENT,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Integer> INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_SETTING =
Setting.intSetting("index.merge.policy.max_merge_at_once", DEFAULT_MAX_MERGE_AT_ONCE, 2,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Integer> INDEX_MERGE_POLICY_MAX_MERGE_AT_ONCE_EXPLICIT_SETTING =
Setting.intSetting("index.merge.policy.max_merge_at_once_explicit", DEFAULT_MAX_MERGE_AT_ONCE_EXPLICIT, 2,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDEX_MERGE_POLICY_MAX_MERGED_SEGMENT_SETTING =
Setting.byteSizeSetting("index.merge.policy.max_merged_segment", DEFAULT_MAX_MERGED_SEGMENT,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Double> INDEX_MERGE_POLICY_SEGMENTS_PER_TIER_SETTING =
Setting.doubleSetting("index.merge.policy.segments_per_tier", DEFAULT_SEGMENTS_PER_TIER, 2.0d,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<Double> INDEX_MERGE_POLICY_RECLAIM_DELETES_WEIGHT_SETTING =
Setting.doubleSetting("index.merge.policy.reclaim_deletes_weight", DEFAULT_RECLAIM_DELETES_WEIGHT, 0.0d,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final String INDEX_MERGE_ENABLED = "index.merge.enabled"; // don't convert to Setting<> and register... we only set this in tests and register via a plugin

View File

@ -21,7 +21,7 @@ package org.elasticsearch.index;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.util.concurrent.EsExecutors;
/**
@ -55,14 +55,14 @@ public final class MergeSchedulerConfig {
public static final Setting<Integer> MAX_THREAD_COUNT_SETTING =
new Setting<>("index.merge.scheduler.max_thread_count",
(s) -> Integer.toString(Math.max(1, Math.min(4, EsExecutors.boundedNumberOfProcessors(s) / 2))),
(s) -> Setting.parseInt(s, 1, "index.merge.scheduler.max_thread_count"), SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
(s) -> Setting.parseInt(s, 1, "index.merge.scheduler.max_thread_count"), Property.Dynamic,
Property.IndexScope);
public static final Setting<Integer> MAX_MERGE_COUNT_SETTING =
new Setting<>("index.merge.scheduler.max_merge_count",
(s) -> Integer.toString(MAX_THREAD_COUNT_SETTING.get(s) + 5),
(s) -> Setting.parseInt(s, 1, "index.merge.scheduler.max_merge_count"), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
(s) -> Setting.parseInt(s, 1, "index.merge.scheduler.max_merge_count"), Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> AUTO_THROTTLE_SETTING =
Setting.boolSetting("index.merge.scheduler.auto_throttle", true, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting("index.merge.scheduler.auto_throttle", true, Property.Dynamic, Property.IndexScope);
private volatile boolean autoThrottle;
private volatile int maxThreadCount;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.search.internal.SearchContext;
@ -53,33 +53,33 @@ public final class SearchSlowLog {
private static final String INDEX_SEARCH_SLOWLOG_PREFIX = "index.search.slowlog";
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_QUERY_WARN_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.query.warn", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_QUERY_INFO_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.query.info", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_QUERY_DEBUG_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.query.debug", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_QUERY_TRACE_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.query.trace", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_WARN_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.fetch.warn", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_INFO_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.fetch.info", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_DEBUG_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.fetch.debug", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<TimeValue> INDEX_SEARCH_SLOWLOG_THRESHOLD_FETCH_TRACE_SETTING =
Setting.timeSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".threshold.fetch.trace", TimeValue.timeValueNanos(-1),
TimeValue.timeValueMillis(-1), SettingsProperty.Dynamic, SettingsProperty.IndexScope);
TimeValue.timeValueMillis(-1), Property.Dynamic, Property.IndexScope);
public static final Setting<Boolean> INDEX_SEARCH_SLOWLOG_REFORMAT =
Setting.boolSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".reformat", true, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting(INDEX_SEARCH_SLOWLOG_PREFIX + ".reformat", true, Property.Dynamic, Property.IndexScope);
public static final Setting<SlowLogLevel> INDEX_SEARCH_SLOWLOG_LEVEL =
new Setting<>(INDEX_SEARCH_SLOWLOG_PREFIX + ".level", SlowLogLevel.TRACE.name(), SlowLogLevel::parse, SettingsProperty.Dynamic,
SettingsProperty.IndexScope);
new Setting<>(INDEX_SEARCH_SLOWLOG_PREFIX + ".level", SlowLogLevel.TRACE.name(), SlowLogLevel::parse, Property.Dynamic,
Property.IndexScope);
public SearchSlowLog(IndexSettings indexSettings) {

View File

@ -38,7 +38,7 @@ import org.elasticsearch.common.cache.RemovalListener;
import org.elasticsearch.common.cache.RemovalNotification;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.IndexSettings;
@ -72,7 +72,7 @@ import java.util.concurrent.Executor;
public final class BitsetFilterCache extends AbstractIndexComponent implements LeafReader.CoreClosedListener, RemovalListener<Object, Cache<Query, BitsetFilterCache.Value>>, Closeable {
public static final Setting<Boolean> INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING =
Setting.boolSetting("index.load_fixed_bitset_filters_eagerly", true, SettingsProperty.IndexScope);
Setting.boolSetting("index.load_fixed_bitset_filters_eagerly", true, Property.IndexScope);
private final boolean loadRandomAccessFiltersEagerly;
private final Cache<Object, Cache<Query, Value>> loadedFilters;

View File

@ -26,7 +26,7 @@ import org.apache.lucene.search.QueryCache;
import org.apache.lucene.search.QueryCachingPolicy;
import org.apache.lucene.search.similarities.Similarity;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -40,8 +40,6 @@ import org.elasticsearch.index.translog.TranslogConfig;
import org.elasticsearch.indices.IndexingMemoryController;
import org.elasticsearch.threadpool.ThreadPool;
import java.util.Set;
/*
* Holds all the configuration that is used to create an {@link Engine}.
* Once {@link Engine} has been created with this object, changes to this
@ -84,7 +82,7 @@ public final class EngineConfig {
}
return s;
}
}, SettingsProperty.IndexScope);
}, Property.IndexScope);
/** if set to true the engine will start even if the translog id in the commit point can not be found */
public static final String INDEX_FORCE_NEW_TRANSLOG = "index.engine.force_new_translog";

View File

@ -24,7 +24,7 @@ import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.fielddata.plain.AbstractGeoPointDVIndexFieldData;
@ -68,7 +68,7 @@ public class IndexFieldDataService extends AbstractIndexComponent implements Clo
default:
throw new IllegalArgumentException("failed to parse [" + s + "] must be one of [node,node]");
}
}, SettingsProperty.IndexScope);
}, Property.IndexScope);
private static final IndexFieldData.Builder MISSING_DOC_VALUES_BUILDER = (indexProperties, fieldType, cache, breakerService, mapperService1) -> {
throw new IllegalStateException("Can't load fielddata on [" + fieldType.name()

View File

@ -29,7 +29,7 @@ import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.analysis.NamedAnalyzer;
@ -51,9 +51,9 @@ import java.util.stream.StreamSupport;
public abstract class FieldMapper extends Mapper implements Cloneable {
public static final Setting<Boolean> IGNORE_MALFORMED_SETTING =
Setting.boolSetting("index.mapping.ignore_malformed", false, SettingsProperty.IndexScope);
Setting.boolSetting("index.mapping.ignore_malformed", false, Property.IndexScope);
public static final Setting<Boolean> COERCE_SETTING =
Setting.boolSetting("index.mapping.coerce", false, SettingsProperty.IndexScope);
Setting.boolSetting("index.mapping.coerce", false, Property.IndexScope);
public abstract static class Builder<T extends Builder, Y extends FieldMapper> extends Mapper.Builder<T, Y> {
protected final MappedFieldType fieldType;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.ElasticsearchGenerationException;
import org.elasticsearch.common.compress.CompressedXContent;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AnalysisService;
@ -83,10 +83,10 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
public static final String DEFAULT_MAPPING = "_default_";
public static final Setting<Long> INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING =
Setting.longSetting("index.mapping.nested_fields.limit", 50L, 0, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.longSetting("index.mapping.nested_fields.limit", 50L, 0, Property.Dynamic, Property.IndexScope);
public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT = true;
public static final Setting<Boolean> INDEX_MAPPER_DYNAMIC_SETTING =
Setting.boolSetting("index.mapper.dynamic", INDEX_MAPPER_DYNAMIC_DEFAULT, SettingsProperty.IndexScope);
Setting.boolSetting("index.mapper.dynamic", INDEX_MAPPER_DYNAMIC_DEFAULT, Property.IndexScope);
private static ObjectHashSet<String> META_FIELDS = ObjectHashSet.from(
"_uid", "_id", "_type", "_all", "_parent", "_routing", "_index",
"_size", "_timestamp", "_ttl"

View File

@ -33,7 +33,7 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentBuilder;
@ -55,7 +55,7 @@ import java.util.List;
public abstract class NumberFieldMapper extends FieldMapper implements AllFieldMapper.IncludeInAll {
// this is private since it has a different default
private static final Setting<Boolean> COERCE_SETTING =
Setting.boolSetting("index.mapping.coerce", true, SettingsProperty.IndexScope);
Setting.boolSetting("index.mapping.coerce", true, Property.IndexScope);
public static class Defaults {

View File

@ -31,14 +31,12 @@ import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.metrics.CounterMetric;
import org.elasticsearch.common.metrics.MeanMetric;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.fielddata.IndexFieldDataService;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.Uid;
import org.elasticsearch.index.mapper.internal.TypeFieldMapper;
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
@ -63,7 +61,7 @@ import java.util.concurrent.TimeUnit;
public final class PercolatorQueriesRegistry extends AbstractIndexShardComponent implements Closeable {
public final static Setting<Boolean> INDEX_MAP_UNMAPPED_FIELDS_AS_STRING_SETTING =
Setting.boolSetting("index.percolator.map_unmapped_fields_as_string", false, SettingsProperty.IndexScope);
Setting.boolSetting("index.percolator.map_unmapped_fields_as_string", false, Property.IndexScope);
private final ConcurrentMap<BytesRef, Query> percolateQueries = ConcurrentCollections.newConcurrentMapWithAggressiveConcurrency();
private final QueryShardContext queryShardContext;

View File

@ -36,8 +36,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.metrics.CounterMetric;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.index.IndexModule;
import org.elasticsearch.index.IndexSettings;
@ -63,7 +62,7 @@ public class FsDirectoryService extends DirectoryService implements StoreRateLim
default:
throw new IllegalArgumentException("unrecognized [index.store.fs.fs_lock] \"" + s + "\": must be native or simple");
}
}, SettingsProperty.IndexScope);
}, Property.IndexScope);
private final CounterMetric rateLimitingTimeInNanos = new CounterMetric();
private final ShardPath path;

View File

@ -21,7 +21,7 @@ package org.elasticsearch.index.store;
import org.apache.lucene.store.StoreRateLimiting;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.index.AbstractIndexComponent;
import org.elasticsearch.index.IndexSettings;
@ -32,10 +32,10 @@ import org.elasticsearch.index.shard.ShardPath;
public class IndexStore extends AbstractIndexComponent {
public static final Setting<IndexRateLimitingType> INDEX_STORE_THROTTLE_TYPE_SETTING =
new Setting<>("index.store.throttle.type", "none", IndexRateLimitingType::fromString,
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDEX_STORE_THROTTLE_MAX_BYTES_PER_SEC_SETTING =
Setting.byteSizeSetting("index.store.throttle.max_bytes_per_sec", new ByteSizeValue(0),
SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Property.Dynamic, Property.IndexScope);
protected final IndexStoreConfig indexStoreConfig;
private final StoreRateLimiting rateLimiting = new StoreRateLimiting();

View File

@ -22,7 +22,7 @@ import org.apache.lucene.store.StoreRateLimiting;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -39,13 +39,13 @@ public class IndexStoreConfig {
*/
public static final Setting<StoreRateLimiting.Type> INDICES_STORE_THROTTLE_TYPE_SETTING =
new Setting<>("indices.store.throttle.type", StoreRateLimiting.Type.NONE.name(),StoreRateLimiting.Type::fromString,
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/**
* Configures the node / cluster level throttle intensity. The default is <tt>10240 MB</tt>
*/
public static final Setting<ByteSizeValue> INDICES_STORE_THROTTLE_MAX_BYTES_PER_SEC_SETTING =
Setting.byteSizeSetting("indices.store.throttle.max_bytes_per_sec", new ByteSizeValue(0),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private volatile StoreRateLimiting.Type rateLimitingType;
private volatile ByteSizeValue rateLimitingThrottle;
private final StoreRateLimiting rateLimiting = new StoreRateLimiting();

View File

@ -49,7 +49,6 @@ import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput;
@ -61,7 +60,7 @@ import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.store.ByteArrayIndexInput;
import org.elasticsearch.common.lucene.store.InputStreamIndexInput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.Callback;
@ -91,7 +90,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.zip.Adler32;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
@ -126,7 +124,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
static final int VERSION = VERSION_WRITE_THROWABLE;
static final String CORRUPTED = "corrupted_";
public static final Setting<TimeValue> INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING =
Setting.timeSetting("index.store.stats_refresh_interval", TimeValue.timeValueSeconds(10), SettingsProperty.IndexScope);
Setting.timeSetting("index.store.stats_refresh_interval", TimeValue.timeValueSeconds(10), Property.IndexScope);
private final AtomicBoolean isClosed = new AtomicBoolean(false);
private final StoreDirectory directory;

View File

@ -32,7 +32,7 @@ import org.apache.lucene.search.Weight;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.lucene.ShardCoreKeyMap;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.index.cache.query.QueryCacheStats;
@ -49,9 +49,9 @@ import java.util.concurrent.ConcurrentHashMap;
public class IndicesQueryCache extends AbstractComponent implements QueryCache, Closeable {
public static final Setting<ByteSizeValue> INDICES_CACHE_QUERY_SIZE_SETTING = Setting.byteSizeSetting(
"indices.queries.cache.size", "10%", SettingsProperty.ClusterScope);
"indices.queries.cache.size", "10%", Property.NodeScope);
public static final Setting<Integer> INDICES_CACHE_QUERY_COUNT_SETTING = Setting.intSetting(
"indices.queries.cache.count", 10000, 1, SettingsProperty.ClusterScope);
"indices.queries.cache.count", 10000, 1, Property.NodeScope);
private final LRUQueryCache cache;
private final ShardCoreKeyMap shardKeyMap = new ShardCoreKeyMap();

View File

@ -34,7 +34,7 @@ import org.elasticsearch.common.cache.RemovalNotification;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
@ -70,11 +70,11 @@ public final class IndicesRequestCache extends AbstractComponent implements Remo
* since we are checking on the cluster state IndexMetaData always.
*/
public static final Setting<Boolean> INDEX_CACHE_REQUEST_ENABLED_SETTING =
Setting.boolSetting("index.requests.cache.enable", false, SettingsProperty.Dynamic, SettingsProperty.IndexScope);
Setting.boolSetting("index.requests.cache.enable", false, Property.Dynamic, Property.IndexScope);
public static final Setting<ByteSizeValue> INDICES_CACHE_QUERY_SIZE =
Setting.byteSizeSetting("indices.requests.cache.size", "1%", SettingsProperty.ClusterScope);
Setting.byteSizeSetting("indices.requests.cache.size", "1%", Property.NodeScope);
public static final Setting<TimeValue> INDICES_CACHE_QUERY_EXPIRE =
Setting.positiveTimeSetting("indices.requests.cache.expire", new TimeValue(0), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("indices.requests.cache.expire", new TimeValue(0), Property.NodeScope);
private final ConcurrentMap<CleanupKey, Boolean> registeredClosedListeners = ConcurrentCollections.newConcurrentMap();
private final Set<CleanupKey> keysToClean = ConcurrentCollections.newConcurrentSet();

View File

@ -47,7 +47,7 @@ import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -117,7 +117,7 @@ public class IndicesService extends AbstractLifecycleComponent<IndicesService> i
public static final String INDICES_SHARDS_CLOSED_TIMEOUT = "indices.shards_closed_timeout";
public static final Setting<TimeValue> INDICES_CACHE_CLEAN_INTERVAL_SETTING =
Setting.positiveTimeSetting("indices.cache.cleanup_interval", TimeValue.timeValueMinutes(1), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("indices.cache.cleanup_interval", TimeValue.timeValueMinutes(1), Property.NodeScope);
private final PluginsService pluginsService;
private final NodeEnvironment nodeEnv;
private final TimeValue shardsClosedTimeout;

View File

@ -24,7 +24,7 @@ import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.io.FileSystemUtils;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
@ -73,11 +73,11 @@ import java.util.function.Function;
public class HunspellService extends AbstractComponent {
public final static Setting<Boolean> HUNSPELL_LAZY_LOAD =
Setting.boolSetting("indices.analysis.hunspell.dictionary.lazy", Boolean.FALSE, SettingsProperty.ClusterScope);
Setting.boolSetting("indices.analysis.hunspell.dictionary.lazy", Boolean.FALSE, Property.NodeScope);
public final static Setting<Boolean> HUNSPELL_IGNORE_CASE =
Setting.boolSetting("indices.analysis.hunspell.dictionary.ignore_case", Boolean.FALSE, SettingsProperty.ClusterScope);
Setting.boolSetting("indices.analysis.hunspell.dictionary.ignore_case", Boolean.FALSE, Property.NodeScope);
public final static Setting<Settings> HUNSPELL_DICTIONARY_OPTIONS =
Setting.groupSetting("indices.analysis.hunspell.dictionary.", SettingsProperty.ClusterScope);
Setting.groupSetting("indices.analysis.hunspell.dictionary.", Property.NodeScope);
private final ConcurrentHashMap<String, Dictionary> dictionaries = new ConcurrentHashMap<>();
private final Map<String, Dictionary> knownDictionaries;
private final boolean defaultIgnoreCase;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -48,21 +48,21 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService {
private final ConcurrentMap<String, CircuitBreaker> breakers = new ConcurrentHashMap();
public static final Setting<ByteSizeValue> TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING =
Setting.byteSizeSetting("indices.breaker.total.limit", "70%", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("indices.breaker.total.limit", "70%", Property.Dynamic, Property.NodeScope);
public static final Setting<ByteSizeValue> FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING =
Setting.byteSizeSetting("indices.breaker.fielddata.limit", "60%", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("indices.breaker.fielddata.limit", "60%", Property.Dynamic, Property.NodeScope);
public static final Setting<Double> FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING =
Setting.doubleSetting("indices.breaker.fielddata.overhead", 1.03d, 0.0d, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.doubleSetting("indices.breaker.fielddata.overhead", 1.03d, 0.0d, Property.Dynamic, Property.NodeScope);
public static final Setting<CircuitBreaker.Type> FIELDDATA_CIRCUIT_BREAKER_TYPE_SETTING =
new Setting<>("indices.breaker.fielddata.type", "memory", CircuitBreaker.Type::parseValue, SettingsProperty.ClusterScope);
new Setting<>("indices.breaker.fielddata.type", "memory", CircuitBreaker.Type::parseValue, Property.NodeScope);
public static final Setting<ByteSizeValue> REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING =
Setting.byteSizeSetting("indices.breaker.request.limit", "40%", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("indices.breaker.request.limit", "40%", Property.Dynamic, Property.NodeScope);
public static final Setting<Double> REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING =
Setting.doubleSetting("indices.breaker.request.overhead", 1.0d, 0.0d, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.doubleSetting("indices.breaker.request.overhead", 1.0d, 0.0d, Property.Dynamic, Property.NodeScope);
public static final Setting<CircuitBreaker.Type> REQUEST_CIRCUIT_BREAKER_TYPE_SETTING =
new Setting<>("indices.breaker.request.type", "memory", CircuitBreaker.Type::parseValue, SettingsProperty.ClusterScope);
new Setting<>("indices.breaker.request.type", "memory", CircuitBreaker.Type::parseValue, Property.NodeScope);

View File

@ -34,7 +34,7 @@ import org.elasticsearch.common.lease.Releasable;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.index.Index;
@ -54,7 +54,7 @@ import java.util.function.ToLongBiFunction;
public class IndicesFieldDataCache extends AbstractComponent implements RemovalListener<IndicesFieldDataCache.Key, Accountable>, Releasable{
public static final Setting<ByteSizeValue> INDICES_FIELDDATA_CACHE_SIZE_KEY =
Setting.byteSizeSetting("indices.fielddata.cache.size", new ByteSizeValue(-1), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("indices.fielddata.cache.size", new ByteSizeValue(-1), Property.NodeScope);
private final IndexFieldDataCache.Listener indicesFieldDataCacheListener;
private final Cache<Key, Accountable> cache;

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
@ -35,7 +35,7 @@ public class RecoverySettings extends AbstractComponent {
public static final Setting<ByteSizeValue> INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING =
Setting.byteSizeSetting("indices.recovery.max_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/**
* how long to wait before retrying after issues cause by cluster state syncing between nodes
@ -43,17 +43,17 @@ public class RecoverySettings extends AbstractComponent {
*/
public static final Setting<TimeValue> INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC_SETTING =
Setting.positiveTimeSetting("indices.recovery.retry_delay_state_sync", TimeValue.timeValueMillis(500),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/** how long to wait before retrying after network related issues */
public static final Setting<TimeValue> INDICES_RECOVERY_RETRY_DELAY_NETWORK_SETTING =
Setting.positiveTimeSetting("indices.recovery.retry_delay_network", TimeValue.timeValueSeconds(5),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/** timeout value to use for requests made as part of the recovery process */
public static final Setting<TimeValue> INDICES_RECOVERY_INTERNAL_ACTION_TIMEOUT_SETTING =
Setting.positiveTimeSetting("indices.recovery.internal_action_timeout", TimeValue.timeValueMinutes(15),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
/**
* timeout value to use for requests made as part of the recovery process that are expected to take long time.
@ -62,7 +62,7 @@ public class RecoverySettings extends AbstractComponent {
public static final Setting<TimeValue> INDICES_RECOVERY_INTERNAL_LONG_ACTION_TIMEOUT_SETTING =
Setting.timeSetting("indices.recovery.internal_action_long_timeout",
(s) -> TimeValue.timeValueMillis(INDICES_RECOVERY_INTERNAL_ACTION_TIMEOUT_SETTING.get(s).millis() * 2).toString(),
TimeValue.timeValueSeconds(0), SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
TimeValue.timeValueSeconds(0), Property.Dynamic, Property.NodeScope);
/**
* recoveries that don't show any activity for more then this interval will be failed.
@ -71,7 +71,7 @@ public class RecoverySettings extends AbstractComponent {
public static final Setting<TimeValue> INDICES_RECOVERY_ACTIVITY_TIMEOUT_SETTING =
Setting.timeSetting("indices.recovery.recovery_activity_timeout",
(s) -> INDICES_RECOVERY_INTERNAL_LONG_ACTION_TIMEOUT_SETTING.getRaw(s) , TimeValue.timeValueSeconds(0),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
public static final ByteSizeValue DEFAULT_CHUNK_SIZE = new ByteSizeValue(512, ByteSizeUnit.KB);

View File

@ -36,7 +36,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
@ -58,7 +58,6 @@ import org.elasticsearch.transport.TransportService;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -72,7 +71,7 @@ public class IndicesStore extends AbstractComponent implements ClusterStateListe
// TODO this class can be foled into either IndicesService and partially into IndicesClusterStateService there is no need for a separate public service
public static final Setting<TimeValue> INDICES_STORE_DELETE_SHARD_TIMEOUT =
Setting.positiveTimeSetting("indices.store.delete.shard.timeout", new TimeValue(30, TimeUnit.SECONDS),
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final String ACTION_SHARD_EXISTS = "internal:index/shard/exists";
private static final EnumSet<IndexShardState> ACTIVE_STATES = EnumSet.of(IndexShardState.STARTED, IndexShardState.RELOCATED);
private final IndicesService indicesService;

View File

@ -38,7 +38,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -70,7 +70,7 @@ public class IndicesTTLService extends AbstractLifecycleComponent<IndicesTTLServ
public static final Setting<TimeValue> INDICES_TTL_INTERVAL_SETTING =
Setting.positiveTimeSetting("indices.ttl.interval", TimeValue.timeValueSeconds(60),
SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Property.Dynamic, Property.NodeScope);
private final ClusterService clusterService;
private final IndicesService indicesService;

View File

@ -21,7 +21,7 @@ package org.elasticsearch.monitor.fs;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.SingleObjectCache;
@ -39,7 +39,7 @@ public class FsService extends AbstractComponent {
public final static Setting<TimeValue> REFRESH_INTERVAL_SETTING =
Setting.timeSetting("monitor.fs.refresh_interval", TimeValue.timeValueSeconds(1), TimeValue.timeValueSeconds(1),
SettingsProperty.ClusterScope);
Property.NodeScope);
public FsService(Settings settings, NodeEnvironment nodeEnvironment) throws IOException {
super(settings);

View File

@ -21,7 +21,7 @@ package org.elasticsearch.monitor.jvm;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.FutureUtils;
@ -48,13 +48,13 @@ public class JvmGcMonitorService extends AbstractLifecycleComponent<JvmGcMonitor
private volatile ScheduledFuture scheduledFuture;
public final static Setting<Boolean> ENABLED_SETTING =
Setting.boolSetting("monitor.jvm.gc.enabled", true, SettingsProperty.ClusterScope);
Setting.boolSetting("monitor.jvm.gc.enabled", true, Property.NodeScope);
public final static Setting<TimeValue> REFRESH_INTERVAL_SETTING =
Setting.timeSetting("monitor.jvm.gc.refresh_interval", TimeValue.timeValueSeconds(1), TimeValue.timeValueSeconds(1),
SettingsProperty.ClusterScope);
Property.NodeScope);
private static String GC_COLLECTOR_PREFIX = "monitor.jvm.gc.collector.";
public final static Setting<Settings> GC_SETTING = Setting.groupSetting(GC_COLLECTOR_PREFIX, SettingsProperty.ClusterScope);
public final static Setting<Settings> GC_SETTING = Setting.groupSetting(GC_COLLECTOR_PREFIX, Property.NodeScope);
static class GcThreshold {
public final String name;

View File

@ -21,7 +21,7 @@ package org.elasticsearch.monitor.jvm;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
@ -38,7 +38,7 @@ public class JvmService extends AbstractComponent {
public final static Setting<TimeValue> REFRESH_INTERVAL_SETTING =
Setting.timeSetting("monitor.jvm.refresh_interval", TimeValue.timeValueSeconds(1), TimeValue.timeValueSeconds(1),
SettingsProperty.ClusterScope);
Property.NodeScope);
public JvmService(Settings settings) {
super(settings);

View File

@ -21,7 +21,7 @@ package org.elasticsearch.monitor.os;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.SingleObjectCache;
@ -40,7 +40,7 @@ public class OsService extends AbstractComponent {
public final static Setting<TimeValue> REFRESH_INTERVAL_SETTING =
Setting.timeSetting("monitor.os.refresh_interval", TimeValue.timeValueSeconds(1), TimeValue.timeValueSeconds(1),
SettingsProperty.ClusterScope);
Property.NodeScope);
public OsService(Settings settings) {
super(settings);

View File

@ -21,7 +21,7 @@ package org.elasticsearch.monitor.process;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.SingleObjectCache;
@ -37,7 +37,7 @@ public final class ProcessService extends AbstractComponent {
public final static Setting<TimeValue> REFRESH_INTERVAL_SETTING =
Setting.timeSetting("monitor.process.refresh_interval", TimeValue.timeValueSeconds(1), TimeValue.timeValueSeconds(1),
SettingsProperty.ClusterScope);
Property.NodeScope);
public ProcessService(Settings settings) {
super(settings);

View File

@ -53,7 +53,7 @@ import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.common.transport.BoundTransportAddress;
@ -131,22 +131,22 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder;
public class Node implements Closeable {
public static final Setting<Boolean> WRITE_PORTS_FIELD_SETTING =
Setting.boolSetting("node.portsfile", false, SettingsProperty.ClusterScope);
Setting.boolSetting("node.portsfile", false, Property.NodeScope);
public static final Setting<Boolean> NODE_CLIENT_SETTING =
Setting.boolSetting("node.client", false, SettingsProperty.ClusterScope);
public static final Setting<Boolean> NODE_DATA_SETTING = Setting.boolSetting("node.data", true, SettingsProperty.ClusterScope);
Setting.boolSetting("node.client", false, Property.NodeScope);
public static final Setting<Boolean> NODE_DATA_SETTING = Setting.boolSetting("node.data", true, Property.NodeScope);
public static final Setting<Boolean> NODE_MASTER_SETTING =
Setting.boolSetting("node.master", true, SettingsProperty.ClusterScope);
Setting.boolSetting("node.master", true, Property.NodeScope);
public static final Setting<Boolean> NODE_LOCAL_SETTING =
Setting.boolSetting("node.local", false, SettingsProperty.ClusterScope);
Setting.boolSetting("node.local", false, Property.NodeScope);
public static final Setting<String> NODE_MODE_SETTING =
new Setting<>("node.mode", "network", Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("node.mode", "network", Function.identity(), Property.NodeScope);
public static final Setting<Boolean> NODE_INGEST_SETTING =
Setting.boolSetting("node.ingest", true, SettingsProperty.ClusterScope);
public static final Setting<String> NODE_NAME_SETTING = Setting.simpleString("node.name", SettingsProperty.ClusterScope);
Setting.boolSetting("node.ingest", true, Property.NodeScope);
public static final Setting<String> NODE_NAME_SETTING = Setting.simpleString("node.name", Property.NodeScope);
// this sucks that folks can mistype client etc and get away with it.
// TODO: we should move this to node.attribute.${name} = ${value} instead.
public static final Setting<Settings> NODE_ATTRIBUTES = Setting.groupSetting("node.", SettingsProperty.ClusterScope);
public static final Setting<Settings> NODE_ATTRIBUTES = Setting.groupSetting("node.", Property.NodeScope);
private static final String CLIENT_TYPE = "node";

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.cli.Terminal;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.env.Environment;
@ -59,7 +59,7 @@ public class InternalSettingsPreparer {
public static final String SECRET_PROMPT_VALUE = "${prompt.secret}";
public static final String TEXT_PROMPT_VALUE = "${prompt.text}";
public static final Setting<Boolean> IGNORE_SYSTEM_PROPERTIES_SETTING =
Setting.boolSetting("config.ignore_system_properties", false, SettingsProperty.ClusterScope);
Setting.boolSetting("config.ignore_system_properties", false, Property.NodeScope);
/**
* Prepares the settings by gathering all elasticsearch system properties and setting defaults.

View File

@ -37,7 +37,7 @@ import org.elasticsearch.common.io.FileSystemUtils;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexModule;
@ -73,7 +73,7 @@ public class PluginsService extends AbstractComponent {
private final List<Tuple<PluginInfo, Plugin>> plugins;
private final PluginsAndModules info;
public static final Setting<List<String>> MANDATORY_SETTING =
Setting.listSetting("plugin.mandatory", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("plugin.mandatory", Collections.emptyList(), Function.identity(), Property.NodeScope);
private final Map<Plugin, List<OnModuleReference>> onModuleReferences;

View File

@ -24,7 +24,7 @@ import org.elasticsearch.common.blobstore.BlobStore;
import org.elasticsearch.common.blobstore.fs.FsBlobStore;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.snapshots.IndexShardRepository;
@ -53,16 +53,16 @@ public class FsRepository extends BlobStoreRepository {
public final static String TYPE = "fs";
public static final Setting<String> LOCATION_SETTING =
new Setting<>("location", "", Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("location", "", Function.identity(), Property.NodeScope);
public static final Setting<String> REPOSITORIES_LOCATION_SETTING =
new Setting<>("repositories.fs.location", LOCATION_SETTING, Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("repositories.fs.location", LOCATION_SETTING, Function.identity(), Property.NodeScope);
public static final Setting<ByteSizeValue> CHUNK_SIZE_SETTING =
Setting.byteSizeSetting("chunk_size", "-1", SettingsProperty.ClusterScope);
Setting.byteSizeSetting("chunk_size", "-1", Property.NodeScope);
public static final Setting<ByteSizeValue> REPOSITORIES_CHUNK_SIZE_SETTING =
Setting.byteSizeSetting("repositories.fs.chunk_size", "-1", SettingsProperty.ClusterScope);
public static final Setting<Boolean> COMPRESS_SETTING = Setting.boolSetting("compress", false, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("repositories.fs.chunk_size", "-1", Property.NodeScope);
public static final Setting<Boolean> COMPRESS_SETTING = Setting.boolSetting("compress", false, Property.NodeScope);
public static final Setting<Boolean> REPOSITORIES_COMPRESS_SETTING =
Setting.boolSetting("repositories.fs.compress", false, SettingsProperty.ClusterScope);
Setting.boolSetting("repositories.fs.compress", false, Property.NodeScope);
private final FsBlobStore blobStore;

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.blobstore.BlobStore;
import org.elasticsearch.common.blobstore.url.URLBlobStore;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.util.URIPattern;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.snapshots.IndexShardRepository;
@ -58,20 +58,20 @@ public class URLRepository extends BlobStoreRepository {
public static final Setting<List<String>> SUPPORTED_PROTOCOLS_SETTING =
Setting.listSetting("repositories.url.supported_protocols", Arrays.asList("http", "https", "ftp", "file", "jar"),
Function.identity(), SettingsProperty.ClusterScope);
Function.identity(), Property.NodeScope);
public static final Setting<List<URIPattern>> ALLOWED_URLS_SETTING =
Setting.listSetting("repositories.url.allowed_urls", Collections.emptyList(), URIPattern::new, SettingsProperty.ClusterScope);
Setting.listSetting("repositories.url.allowed_urls", Collections.emptyList(), URIPattern::new, Property.NodeScope);
public static final Setting<URL> URL_SETTING = new Setting<>("url", "http:", URLRepository::parseURL, SettingsProperty.ClusterScope);
public static final Setting<URL> URL_SETTING = new Setting<>("url", "http:", URLRepository::parseURL, Property.NodeScope);
public static final Setting<URL> REPOSITORIES_URL_SETTING =
new Setting<>("repositories.url.url", (s) -> s.get("repositories.uri.url", "http:"), URLRepository::parseURL,
SettingsProperty.ClusterScope);
Property.NodeScope);
public static final Setting<Boolean> LIST_DIRECTORIES_SETTING =
Setting.boolSetting("list_directories", true, SettingsProperty.ClusterScope);
Setting.boolSetting("list_directories", true, Property.NodeScope);
public static final Setting<Boolean> REPOSITORIES_LIST_DIRECTORIES_SETTING =
Setting.boolSetting("repositories.uri.list_directories", true, SettingsProperty.ClusterScope);
Setting.boolSetting("repositories.uri.list_directories", true, Property.NodeScope);
private final List<String> supportedProtocols;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.client.Client;
import org.elasticsearch.common.ParseFieldMatcher;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
/**
@ -36,7 +36,7 @@ import org.elasticsearch.common.settings.Settings;
*/
public abstract class BaseRestHandler extends AbstractComponent implements RestHandler {
public static final Setting<Boolean> MULTI_ALLOW_EXPLICIT_INDEX =
Setting.boolSetting("rest.action.multi.allow_explicit_index", true, SettingsProperty.ClusterScope);
Setting.boolSetting("rest.action.multi.allow_explicit_index", true, Property.NodeScope);
private final Client client;
protected final ParseFieldMatcher parseFieldMatcher;

View File

@ -46,7 +46,7 @@ import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
@ -56,7 +56,6 @@ import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.query.TemplateQueryParser;
import org.elasticsearch.search.internal.SearchContext;
import org.elasticsearch.search.lookup.SearchLookup;
import org.elasticsearch.watcher.FileChangesListener;
import org.elasticsearch.watcher.FileWatcher;
@ -86,12 +85,12 @@ public class ScriptService extends AbstractComponent implements Closeable {
static final String DISABLE_DYNAMIC_SCRIPTING_SETTING = "script.disable_dynamic";
public static final Setting<Integer> SCRIPT_CACHE_SIZE_SETTING =
Setting.intSetting("script.cache.max_size", 100, 0, SettingsProperty.ClusterScope);
Setting.intSetting("script.cache.max_size", 100, 0, Property.NodeScope);
public static final Setting<TimeValue> SCRIPT_CACHE_EXPIRE_SETTING =
Setting.positiveTimeSetting("script.cache.expire", TimeValue.timeValueMillis(0), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("script.cache.expire", TimeValue.timeValueMillis(0), Property.NodeScope);
public static final String SCRIPT_INDEX = ".scripts";
public static final Setting<Boolean> SCRIPT_AUTO_RELOAD_ENABLED_SETTING =
Setting.boolSetting("script.auto_reload_enabled", true, SettingsProperty.ClusterScope);
Setting.boolSetting("script.auto_reload_enabled", true, Property.NodeScope);
private final String defaultLang;

View File

@ -21,7 +21,7 @@ package org.elasticsearch.script;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.ArrayList;
@ -45,7 +45,7 @@ public class ScriptSettings {
ScriptModes.sourceKey(scriptType),
scriptType.getDefaultScriptMode().getMode(),
ScriptMode::parse,
SettingsProperty.ClusterScope));
Property.NodeScope));
}
SCRIPT_TYPE_SETTING_MAP = Collections.unmodifiableMap(scriptTypeSettingMap);
}
@ -66,7 +66,7 @@ public class ScriptSettings {
throw new IllegalArgumentException("unregistered default language [" + setting + "]");
}
return setting;
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
}
private static Map<ScriptContext, Setting<ScriptMode>> contextSettings(ScriptContextRegistry scriptContextRegistry) {
@ -76,7 +76,7 @@ public class ScriptSettings {
ScriptModes.operationKey(scriptContext),
ScriptMode.OFF.getMode(),
ScriptMode::parse,
SettingsProperty.ClusterScope
Property.NodeScope
));
}
return scriptContextSettingMap;
@ -136,7 +136,7 @@ public class ScriptSettings {
ScriptModes.getKey(language, scriptType, scriptContext),
defaultSetting,
ScriptMode::parse,
SettingsProperty.ClusterScope);
Property.NodeScope);
scriptModeSettings.add(setting);
}
}

View File

@ -34,7 +34,7 @@ import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.BigArrays;
@ -55,7 +55,6 @@ import org.elasticsearch.index.search.stats.StatsGroupsParseElement;
import org.elasticsearch.index.shard.IndexEventListener;
import org.elasticsearch.index.shard.IndexShard;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.indices.IndicesRequestCache;
import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.script.ScriptService;
@ -113,13 +112,13 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> imp
// we can have 5 minutes here, since we make sure to clean with search requests and when shard/index closes
public static final Setting<TimeValue> DEFAULT_KEEPALIVE_SETTING =
Setting.positiveTimeSetting("search.default_keep_alive", timeValueMinutes(5), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("search.default_keep_alive", timeValueMinutes(5), Property.NodeScope);
public static final Setting<TimeValue> KEEPALIVE_INTERVAL_SETTING =
Setting.positiveTimeSetting("search.keep_alive_interval", timeValueMinutes(1), SettingsProperty.ClusterScope);
Setting.positiveTimeSetting("search.keep_alive_interval", timeValueMinutes(1), Property.NodeScope);
public static final TimeValue NO_TIMEOUT = timeValueMillis(-1);
public static final Setting<TimeValue> DEFAULT_SEARCH_TIMEOUT_SETTING =
Setting.timeSetting("search.default_search_timeout", NO_TIMEOUT, SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.timeSetting("search.default_search_timeout", NO_TIMEOUT, Property.Dynamic, Property.NodeScope);
private final ThreadPool threadPool;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.common.unit.SizeValue;
@ -190,7 +190,7 @@ public class ThreadPool extends AbstractComponent implements Closeable {
}
public static final Setting<Settings> THREADPOOL_GROUP_SETTING =
Setting.groupSetting("threadpool.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Setting.groupSetting("threadpool.", Property.Dynamic, Property.NodeScope);
private volatile Map<String, ExecutorHolder> executors;

View File

@ -22,7 +22,7 @@ package org.elasticsearch.transport;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.transport.BoundTransportAddress;
import org.elasticsearch.common.transport.TransportAddress;
@ -36,7 +36,7 @@ import java.util.Map;
public interface Transport extends LifecycleComponent<Transport> {
Setting<Boolean> TRANSPORT_TCP_COMPRESS = Setting.boolSetting("transport.tcp.compress", false, SettingsProperty.ClusterScope);
Setting<Boolean> TRANSPORT_TCP_COMPRESS = Setting.boolSetting("transport.tcp.compress", false, Property.NodeScope);
void transportServiceAdapter(TransportServiceAdapter service);

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.metrics.MeanMetric;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.BoundTransportAddress;
import org.elasticsearch.common.transport.TransportAddress;
@ -99,10 +99,10 @@ public class TransportService extends AbstractLifecycleComponent<TransportServic
// tracer log
public static final Setting<List<String>> TRACE_LOG_INCLUDE_SETTING =
listSetting("transport.tracer.include", emptyList(), Function.identity(), SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
listSetting("transport.tracer.include", emptyList(), Function.identity(), Property.Dynamic, Property.NodeScope);
public static final Setting<List<String>> TRACE_LOG_EXCLUDE_SETTING =
listSetting("transport.tracer.exclude", Arrays.asList("internal:discovery/zen/fd*", TransportLivenessAction.NAME),
Function.identity(), SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
Function.identity(), Property.Dynamic, Property.NodeScope);
private final ESLogger tracerLog;

View File

@ -19,7 +19,7 @@
package org.elasticsearch.transport;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import java.util.List;
@ -37,18 +37,18 @@ import static org.elasticsearch.common.settings.Setting.listSetting;
final public class TransportSettings {
public static final Setting<List<String>> HOST =
listSetting("transport.host", emptyList(), Function.identity(), SettingsProperty.ClusterScope);
listSetting("transport.host", emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> PUBLISH_HOST =
listSetting("transport.publish_host", HOST, Function.identity(), SettingsProperty.ClusterScope);
listSetting("transport.publish_host", HOST, Function.identity(), Property.NodeScope);
public static final Setting<List<String>> BIND_HOST =
listSetting("transport.bind_host", HOST, Function.identity(), SettingsProperty.ClusterScope);
listSetting("transport.bind_host", HOST, Function.identity(), Property.NodeScope);
public static final Setting<String> PORT =
new Setting<>("transport.tcp.port", "9300-9400", Function.identity(), SettingsProperty.ClusterScope);
new Setting<>("transport.tcp.port", "9300-9400", Function.identity(), Property.NodeScope);
public static final Setting<Integer> PUBLISH_PORT =
intSetting("transport.publish_port", -1, -1, SettingsProperty.ClusterScope);
intSetting("transport.publish_port", -1, -1, Property.NodeScope);
public static final String DEFAULT_PROFILE = "default";
public static final Setting<Settings> TRANSPORT_PROFILES_SETTING =
groupSetting("transport.profiles.", SettingsProperty.Dynamic, SettingsProperty.ClusterScope);
groupSetting("transport.profiles.", Property.Dynamic, Property.NodeScope);
private TransportSettings() {

View File

@ -44,7 +44,7 @@ import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.network.NetworkService.TcpSettings;
import org.elasticsearch.common.network.NetworkUtils;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.BoundTransportAddress;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
@ -152,42 +152,42 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
public static final Setting<Integer> WORKER_COUNT =
new Setting<>("transport.netty.worker_count",
(s) -> Integer.toString(EsExecutors.boundedNumberOfProcessors(s) * 2),
(s) -> Setting.parseInt(s, 1, "transport.netty.worker_count"), SettingsProperty.ClusterScope);
(s) -> Setting.parseInt(s, 1, "transport.netty.worker_count"), Property.NodeScope);
public static final Setting<Integer> CONNECTIONS_PER_NODE_RECOVERY =
intSetting("transport.connections_per_node.recovery", 2, 1, SettingsProperty.ClusterScope);
intSetting("transport.connections_per_node.recovery", 2, 1, Property.NodeScope);
public static final Setting<Integer> CONNECTIONS_PER_NODE_BULK =
intSetting("transport.connections_per_node.bulk", 3, 1, SettingsProperty.ClusterScope);
intSetting("transport.connections_per_node.bulk", 3, 1, Property.NodeScope);
public static final Setting<Integer> CONNECTIONS_PER_NODE_REG =
intSetting("transport.connections_per_node.reg", 6, 1, SettingsProperty.ClusterScope);
intSetting("transport.connections_per_node.reg", 6, 1, Property.NodeScope);
public static final Setting<Integer> CONNECTIONS_PER_NODE_STATE =
intSetting("transport.connections_per_node.state", 1, 1, SettingsProperty.ClusterScope);
intSetting("transport.connections_per_node.state", 1, 1, Property.NodeScope);
public static final Setting<Integer> CONNECTIONS_PER_NODE_PING =
intSetting("transport.connections_per_node.ping", 1, 1, SettingsProperty.ClusterScope);
intSetting("transport.connections_per_node.ping", 1, 1, Property.NodeScope);
// the scheduled internal ping interval setting, defaults to disabled (-1)
public static final Setting<TimeValue> PING_SCHEDULE =
timeSetting("transport.ping_schedule", TimeValue.timeValueSeconds(-1), SettingsProperty.ClusterScope);
timeSetting("transport.ping_schedule", TimeValue.timeValueSeconds(-1), Property.NodeScope);
public static final Setting<Boolean> TCP_BLOCKING_CLIENT =
boolSetting("transport.tcp.blocking_client", TcpSettings.TCP_BLOCKING_CLIENT, SettingsProperty.ClusterScope);
boolSetting("transport.tcp.blocking_client", TcpSettings.TCP_BLOCKING_CLIENT, Property.NodeScope);
public static final Setting<TimeValue> TCP_CONNECT_TIMEOUT =
timeSetting("transport.tcp.connect_timeout", TcpSettings.TCP_CONNECT_TIMEOUT, SettingsProperty.ClusterScope);
timeSetting("transport.tcp.connect_timeout", TcpSettings.TCP_CONNECT_TIMEOUT, Property.NodeScope);
public static final Setting<Boolean> TCP_NO_DELAY =
boolSetting("transport.tcp_no_delay", TcpSettings.TCP_NO_DELAY, SettingsProperty.ClusterScope);
boolSetting("transport.tcp_no_delay", TcpSettings.TCP_NO_DELAY, Property.NodeScope);
public static final Setting<Boolean> TCP_KEEP_ALIVE =
boolSetting("transport.tcp.keep_alive", TcpSettings.TCP_KEEP_ALIVE, SettingsProperty.ClusterScope);
boolSetting("transport.tcp.keep_alive", TcpSettings.TCP_KEEP_ALIVE, Property.NodeScope);
public static final Setting<Boolean> TCP_BLOCKING_SERVER =
boolSetting("transport.tcp.blocking_server", TcpSettings.TCP_BLOCKING_SERVER, SettingsProperty.ClusterScope);
boolSetting("transport.tcp.blocking_server", TcpSettings.TCP_BLOCKING_SERVER, Property.NodeScope);
public static final Setting<Boolean> TCP_REUSE_ADDRESS =
boolSetting("transport.tcp.reuse_address", TcpSettings.TCP_REUSE_ADDRESS, SettingsProperty.ClusterScope);
boolSetting("transport.tcp.reuse_address", TcpSettings.TCP_REUSE_ADDRESS, Property.NodeScope);
public static final Setting<ByteSizeValue> TCP_SEND_BUFFER_SIZE =
Setting.byteSizeSetting("transport.tcp.send_buffer_size", TcpSettings.TCP_SEND_BUFFER_SIZE, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("transport.tcp.send_buffer_size", TcpSettings.TCP_SEND_BUFFER_SIZE, Property.NodeScope);
public static final Setting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE =
Setting.byteSizeSetting("transport.tcp.receive_buffer_size", TcpSettings.TCP_RECEIVE_BUFFER_SIZE, SettingsProperty.ClusterScope);
Setting.byteSizeSetting("transport.tcp.receive_buffer_size", TcpSettings.TCP_RECEIVE_BUFFER_SIZE, Property.NodeScope);
public static final Setting<ByteSizeValue> NETTY_MAX_CUMULATION_BUFFER_CAPACITY =
Setting.byteSizeSetting("transport.netty.max_cumulation_buffer_capacity", new ByteSizeValue(-1), SettingsProperty.ClusterScope);
Setting.byteSizeSetting("transport.netty.max_cumulation_buffer_capacity", new ByteSizeValue(-1), Property.NodeScope);
public static final Setting<Integer> NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS =
Setting.intSetting("transport.netty.max_composite_buffer_components", -1, -1, SettingsProperty.ClusterScope);
Setting.intSetting("transport.netty.max_composite_buffer_components", -1, -1, Property.NodeScope);
// See AdaptiveReceiveBufferSizePredictor#DEFAULT_XXX for default values in netty..., we can use higher ones for us, even fixed one
public static final Setting<ByteSizeValue> NETTY_RECEIVE_PREDICTOR_SIZE = Setting.byteSizeSetting(
@ -200,13 +200,13 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
defaultReceiverPredictor = Math.min(defaultReceiverPredictor, Math.max(l, 64 * 1024));
}
return new ByteSizeValue(defaultReceiverPredictor).toString();
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
public static final Setting<ByteSizeValue> NETTY_RECEIVE_PREDICTOR_MIN =
byteSizeSetting("transport.netty.receive_predictor_min", NETTY_RECEIVE_PREDICTOR_SIZE, SettingsProperty.ClusterScope);
byteSizeSetting("transport.netty.receive_predictor_min", NETTY_RECEIVE_PREDICTOR_SIZE, Property.NodeScope);
public static final Setting<ByteSizeValue> NETTY_RECEIVE_PREDICTOR_MAX =
byteSizeSetting("transport.netty.receive_predictor_max", NETTY_RECEIVE_PREDICTOR_SIZE, SettingsProperty.ClusterScope);
byteSizeSetting("transport.netty.receive_predictor_max", NETTY_RECEIVE_PREDICTOR_SIZE, Property.NodeScope);
public static final Setting<Integer> NETTY_BOSS_COUNT =
intSetting("transport.netty.boss_count", 1, 1, SettingsProperty.ClusterScope);
intSetting("transport.netty.boss_count", 1, 1, Property.NodeScope);
protected final NetworkService networkService;
protected final Version version;

View File

@ -43,7 +43,7 @@ import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
import org.elasticsearch.common.util.set.Sets;
@ -120,7 +120,7 @@ public class TribeService extends AbstractLifecycleComponent<TribeService> {
}
// internal settings only
public static final Setting<String> TRIBE_NAME_SETTING = Setting.simpleString("tribe.name", SettingsProperty.ClusterScope);
public static final Setting<String> TRIBE_NAME_SETTING = Setting.simpleString("tribe.name", Property.NodeScope);
private final ClusterService clusterService;
private final String[] blockIndicesWrite;
private final String[] blockIndicesRead;
@ -139,18 +139,18 @@ public class TribeService extends AbstractLifecycleComponent<TribeService> {
throw new IllegalArgumentException(
"Invalid value for [tribe.on_conflict] must be either [any, drop or start with prefer_] but was: [" + s + "]");
}
}, SettingsProperty.ClusterScope);
}, Property.NodeScope);
public static final Setting<Boolean> BLOCKS_METADATA_SETTING =
Setting.boolSetting("tribe.blocks.metadata", false, SettingsProperty.ClusterScope);
Setting.boolSetting("tribe.blocks.metadata", false, Property.NodeScope);
public static final Setting<Boolean> BLOCKS_WRITE_SETTING =
Setting.boolSetting("tribe.blocks.write", false, SettingsProperty.ClusterScope);
Setting.boolSetting("tribe.blocks.write", false, Property.NodeScope);
public static final Setting<List<String>> BLOCKS_WRITE_INDICES_SETTING =
Setting.listSetting("tribe.blocks.write.indices", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("tribe.blocks.write.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> BLOCKS_READ_INDICES_SETTING =
Setting.listSetting("tribe.blocks.read.indices", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("tribe.blocks.read.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Setting<List<String>> BLOCKS_METADATA_INDICES_SETTING =
Setting.listSetting("tribe.blocks.metadata.indices", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
Setting.listSetting("tribe.blocks.metadata.indices", Collections.emptyList(), Function.identity(), Property.NodeScope);
public static final Set<String> TRIBE_SETTING_KEYS = Sets.newHashSet(TRIBE_NAME_SETTING.getKey(), ON_CONFLICT_SETTING.getKey(),
BLOCKS_METADATA_INDICES_SETTING.getKey(), BLOCKS_METADATA_SETTING.getKey(), BLOCKS_READ_INDICES_SETTING.getKey(), BLOCKS_WRITE_INDICES_SETTING.getKey(), BLOCKS_WRITE_SETTING.getKey());

View File

@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.hasSize;
/**
* This class tests that repository operations (Put, Delete, Verify) are blocked when the cluster is read-only.
*
* The @ClusterScope TEST is needed because this class updates the cluster setting "cluster.blocks.read_only".
* The @NodeScope TEST is needed because this class updates the cluster setting "cluster.blocks.read_only".
*/
@ClusterScope(scope = ESIntegTestCase.Scope.TEST)
public class RepositoryBlocksIT extends ESIntegTestCase {

View File

@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.hasSize;
/**
* This class tests that snapshot operations (Create, Delete, Restore) are blocked when the cluster is read-only.
*
* The @ClusterScope TEST is needed because this class updates the cluster setting "cluster.blocks.read_only".
* The @NodeScope TEST is needed because this class updates the cluster setting "cluster.blocks.read_only".
*/
@ClusterScope(scope = ESIntegTestCase.Scope.TEST)
public class SnapshotBlocksIT extends ESIntegTestCase {

View File

@ -35,7 +35,7 @@ import org.elasticsearch.common.inject.ModuleTestCase;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
@ -84,7 +84,7 @@ public class ClusterModuleTests extends ModuleTestCase {
public void testRegisterClusterDynamicSetting() {
SettingsModule module = new SettingsModule(Settings.EMPTY);
module.registerSetting(Setting.boolSetting("foo.bar", false, SettingsProperty.Dynamic, SettingsProperty.ClusterScope));
module.registerSetting(Setting.boolSetting("foo.bar", false, Property.Dynamic, Property.NodeScope));
assertInstanceBinding(module, ClusterSettings.class, service -> service.hasDynamicSetting("foo.bar"));
}
@ -99,7 +99,7 @@ public class ClusterModuleTests extends ModuleTestCase {
public void testRegisterIndexDynamicSetting() {
SettingsModule module = new SettingsModule(Settings.EMPTY);
module.registerSetting(Setting.boolSetting("foo.bar", false, SettingsProperty.Dynamic, SettingsProperty.IndexScope));
module.registerSetting(Setting.boolSetting("foo.bar", false, Property.Dynamic, Property.IndexScope));
assertInstanceBinding(module, IndexScopedSettings.class, service -> service.hasDynamicSetting("foo.bar"));
}

View File

@ -23,7 +23,7 @@ import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.plugins.Plugin;
@ -47,9 +47,9 @@ public class SettingsFilteringIT extends ESIntegTestCase {
public static class SettingsFilteringPlugin extends Plugin {
public static final Setting<Boolean> SOME_NODE_SETTING =
Setting.boolSetting("some.node.setting", false, SettingsProperty.ClusterScope, SettingsProperty.Filtered);
Setting.boolSetting("some.node.setting", false, Property.NodeScope, Property.Filtered);
public static final Setting<Boolean> SOME_OTHER_NODE_SETTING =
Setting.boolSetting("some.other.node.setting", false, SettingsProperty.ClusterScope);
Setting.boolSetting("some.other.node.setting", false, Property.NodeScope);
/**
* The name of the plugin.
@ -75,7 +75,7 @@ public class SettingsFilteringIT extends ESIntegTestCase {
public void onModule(SettingsModule module) {
module.registerSetting(SOME_NODE_SETTING);
module.registerSetting(SOME_OTHER_NODE_SETTING);
module.registerSetting(Setting.groupSetting("index.filter_test.", SettingsProperty.IndexScope));
module.registerSetting(Setting.groupSetting("index.filter_test.", Property.IndexScope));
module.registerSettingsFilter("index.filter_test.foo");
module.registerSettingsFilter("index.filter_test.bar*");
}

Some files were not shown because too many files have changed in this diff Show More