Fix merge with master

This commit is contained in:
David Pilato 2016-03-02 09:49:52 +01:00
parent 5fbf1b95dc
commit e4d9e46508
5 changed files with 17 additions and 13 deletions

View File

@ -106,7 +106,7 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
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, false, Setting.Scope.CLUSTER);
Setting.longSetting("node_id.seed", 0L, Long.MIN_VALUE, SettingsProperty.ClusterScope);
private final ThreadPool threadPool;
private BiConsumer<ClusterChangedEvent, Discovery.AckListener> clusterStatePublisher;

View File

@ -310,9 +310,9 @@ public class ScopedSettingsTests extends ESTestCase {
public void testOverlappingComplexMatchSettings() {
Set<Setting<?>> settings = new LinkedHashSet<>(2);
final boolean groupFirst = randomBoolean();
final Setting<?> groupSetting = Setting.groupSetting("foo.", false, Setting.Scope.CLUSTER);
final Setting<?> listSetting = Setting.listSetting("foo.bar", Collections.emptyList(), Function.identity(), false,
Setting.Scope.CLUSTER);
final Setting<?> groupSetting = Setting.groupSetting("foo.", SettingsProperty.ClusterScope);
final Setting<?> listSetting =
Setting.listSetting("foo.bar", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
settings.add(groupFirst ? groupSetting : listSetting);
settings.add(groupFirst ? listSetting : groupSetting);

View File

@ -22,6 +22,7 @@ package org.elasticsearch.cloud.gce;
import com.google.api.services.compute.model.Instance;
import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
@ -41,25 +42,25 @@ public interface GceComputeService extends LifecycleComponent<GceComputeService>
/**
* cloud.gce.project_id: Google project id
*/
Setting<String> PROJECT_SETTING = Setting.simpleString("cloud.gce.project_id", false, Setting.Scope.CLUSTER);
Setting<String> PROJECT_SETTING = Setting.simpleString("cloud.gce.project_id", SettingsProperty.ClusterScope);
/**
* cloud.gce.zone: Google Compute Engine zones
*/
Setting<List<String>> ZONE_SETTING =
Setting.listSetting("cloud.gce.zone", Collections.emptyList(), s -> s, false, Setting.Scope.CLUSTER);
Setting.listSetting("cloud.gce.zone", Collections.emptyList(), s -> s, SettingsProperty.ClusterScope);
/**
* cloud.gce.refresh_interval: How long the list of hosts is cached to prevent further requests to the AWS API. 0 disables caching.
* A negative value will cause infinite caching. Defaults to 0s.
*/
Setting<TimeValue> REFRESH_SETTING =
Setting.timeSetting("cloud.gce.refresh_interval", TimeValue.timeValueSeconds(0), false, Setting.Scope.CLUSTER);
Setting.timeSetting("cloud.gce.refresh_interval", TimeValue.timeValueSeconds(0), SettingsProperty.ClusterScope);
/**
* cloud.gce.retry: Should we retry calling GCE API in case of error? Defaults to true.
*/
Setting<Boolean> RETRY_SETTING = Setting.boolSetting("cloud.gce.retry", true, false, Setting.Scope.CLUSTER);
Setting<Boolean> RETRY_SETTING = Setting.boolSetting("cloud.gce.retry", true, SettingsProperty.ClusterScope);
/**
* cloud.gce.max_wait: How long exponential backoff should retry before definitely failing.
@ -67,7 +68,7 @@ public interface GceComputeService extends LifecycleComponent<GceComputeService>
* A negative value will retry indefinitely. Defaults to `-1s` (retry indefinitely).
*/
Setting<TimeValue> MAX_WAIT_SETTING =
Setting.timeSetting("cloud.gce.max_wait", TimeValue.timeValueSeconds(-1), false, Setting.Scope.CLUSTER);
Setting.timeSetting("cloud.gce.max_wait", TimeValue.timeValueSeconds(-1), SettingsProperty.ClusterScope);
/**
* Return a collection of running instances within the same GCE project

View File

@ -38,6 +38,7 @@ import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.SettingsProperty;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.discovery.gce.RetryHttpInitializerWrapper;
@ -61,11 +62,11 @@ public class GceComputeServiceImpl extends AbstractLifecycleComponent<GceCompute
// all settings just used for testing - not registered by default
public static final Setting<Boolean> GCE_VALIDATE_CERTIFICATES =
Setting.boolSetting("cloud.gce.validate_certificates", true, false, Setting.Scope.CLUSTER);
Setting.boolSetting("cloud.gce.validate_certificates", true, SettingsProperty.ClusterScope);
public static final Setting<String> GCE_HOST =
new Setting<>("cloud.gce.host", "http://metadata.google.internal", Function.identity(), false, Setting.Scope.CLUSTER);
new Setting<>("cloud.gce.host", "http://metadata.google.internal", Function.identity(), SettingsProperty.ClusterScope);
public static final Setting<String> GCE_ROOT_URL =
new Setting<>("cloud.gce.root_url", "https://www.googleapis.com", Function.identity(), false, Setting.Scope.CLUSTER);
new Setting<>("cloud.gce.root_url", "https://www.googleapis.com", Function.identity(), SettingsProperty.ClusterScope);
private final String project;
private final List<String> zones;

View File

@ -31,6 +31,7 @@ import org.elasticsearch.common.inject.Inject;
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.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.common.unit.TimeValue;
@ -43,6 +44,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
/**
*
@ -53,7 +55,7 @@ public class GceUnicastHostsProvider extends AbstractComponent implements Unicas
* discovery.gce.tags: The gce discovery can filter machines to include in the cluster based on tags.
*/
public static final Setting<List<String>> TAGS_SETTING =
Setting.listSetting("discovery.gce.tags", Collections.emptyList(), s -> s, false, Setting.Scope.CLUSTER);
Setting.listSetting("discovery.gce.tags", Collections.emptyList(), Function.identity(), SettingsProperty.ClusterScope);
static final class Status {
private static final String TERMINATED = "TERMINATED";