1
0
Эх сурвалжийг харах

Fix after merge with master

David Pilato 9 жил өмнө
parent
commit
e9e1e25998

+ 5 - 1
core/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java

@@ -35,6 +35,10 @@ import org.elasticsearch.transport.TransportService;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ScheduledFuture;
 
+import static org.elasticsearch.common.settings.Setting.Property;
+import static org.elasticsearch.common.settings.Setting.positiveTimeSetting;
+
+
 /**
  * This component is responsible for connecting to nodes once they are added to the cluster state, and disconnect when they are
  * removed. Also, it periodically checks that all connections are still open and if needed restores them.
@@ -45,7 +49,7 @@ import java.util.concurrent.ScheduledFuture;
 public class NodeConnectionsService extends AbstractLifecycleComponent<NodeConnectionsService> {
 
     public static final Setting<TimeValue> CLUSTER_NODE_RECONNECT_INTERVAL_SETTING =
-            Setting.positiveTimeSetting("cluster.nodes.reconnect_interval", TimeValue.timeValueSeconds(10), false, Setting.Scope.CLUSTER);
+            positiveTimeSetting("cluster.nodes.reconnect_interval", TimeValue.timeValueSeconds(10), Property.NodeScope);
     private final ThreadPool threadPool;
     private final TransportService transportService;
 

+ 2 - 1
core/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodeService.java

@@ -25,6 +25,7 @@ import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.component.AbstractComponent;
 import org.elasticsearch.common.inject.Inject;
 import org.elasticsearch.common.settings.Setting;
+import org.elasticsearch.common.settings.Setting.Property;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.transport.TransportAddress;
 
@@ -40,7 +41,7 @@ public class DiscoveryNodeService extends AbstractComponent {
 
     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, false, Setting.Scope.CLUSTER);
+            Setting.longSetting("node_id.seed", 0L, Long.MIN_VALUE, Property.NodeScope);
     private final List<CustomAttributesProvider> customAttributesProviders = new CopyOnWriteArrayList<>();
     private final Version version;
 

+ 2 - 2
core/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

@@ -137,14 +137,14 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
         EngineConfig.INDEX_CODEC_SETTING,
         IndexWarmer.INDEX_NORMS_LOADING_SETTING,
         // validate that built-in similarities don't get redefined
-        Setting.groupSetting("index.similarity.", Property.IndexScope, (s) -> {
+        Setting.groupSetting("index.similarity.", (s) -> {
             Map<String, Settings> groups = s.getAsGroups();
             for (String key : SimilarityService.BUILT_IN.keySet()) {
                 if (groups.containsKey(key)) {
                     throw new IllegalArgumentException("illegal value for [index.similarity."+ key + "] cannot redefine built-in similarity");
                 }
             }
-        }), // this allows similarity settings to be passed
+        }, Property.IndexScope), // this allows similarity settings to be passed
         Setting.groupSetting("index.analysis.", Property.IndexScope) // this allows analysis settings to be passed
 
     )));

+ 3 - 3
core/src/main/java/org/elasticsearch/common/settings/Setting.java

@@ -586,10 +586,10 @@ public class Setting<T> extends ToXContentToBytes {
             throw new ElasticsearchException(ex);
         }
     }
-    public static Setting<Settings> groupSetting(String key, boolean dynamic, Scope scope) {
-        return groupSetting(key, dynamic, scope, (s) -> {});
-    }
     public static Setting<Settings> groupSetting(String key, Property... properties) {
+        return groupSetting(key, (s) -> {}, properties);
+    }
+    public static Setting<Settings> groupSetting(String key, Consumer<Settings> validator, Property... properties) {
         return new Setting<Settings>(new GroupKey(key), (s) -> "", (s) -> null, properties) {
             @Override
             public boolean isGroupSetting() {