Fix after merge with master

This commit is contained in:
David Pilato 2016-03-13 15:01:09 +01:00
parent 9acb0bb28c
commit e9e1e25998
4 changed files with 12 additions and 7 deletions

View File

@ -35,6 +35,10 @@ import org.elasticsearch.transport.TransportService;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ScheduledFuture; 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 * 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. * 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 class NodeConnectionsService extends AbstractLifecycleComponent<NodeConnectionsService> {
public static final Setting<TimeValue> CLUSTER_NODE_RECONNECT_INTERVAL_SETTING = 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 ThreadPool threadPool;
private final TransportService transportService; private final TransportService transportService;

View File

@ -25,6 +25,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.transport.TransportAddress;
@ -40,7 +41,7 @@ public class DiscoveryNodeService extends AbstractComponent {
public static final Setting<Long> NODE_ID_SEED_SETTING = public static final Setting<Long> NODE_ID_SEED_SETTING =
// don't use node.id.seed so it won't be seen as an attribute // 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 List<CustomAttributesProvider> customAttributesProviders = new CopyOnWriteArrayList<>();
private final Version version; private final Version version;

View File

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

View File

@ -586,10 +586,10 @@ public class Setting<T> extends ToXContentToBytes {
throw new ElasticsearchException(ex); 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) { 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) { return new Setting<Settings>(new GroupKey(key), (s) -> "", (s) -> null, properties) {
@Override @Override
public boolean isGroupSetting() { public boolean isGroupSetting() {