diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java index 29d30c49d19..e0497104592 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java @@ -115,7 +115,9 @@ public class MetaData implements Iterable { public static final MetaData EMPTY_META_DATA = builder().build(); - public static final String GLOBAL_PERSISTENT_ONLY_PARAM = "global_persistent_only"; + public static final String GLOBAL_ONLY_PARAM = "global_only"; + + public static final String PERSISTENT_ONLY_PARAM = "persistent_only"; private final String uuid; private final long version; @@ -1231,7 +1233,8 @@ public class MetaData implements Iterable { } public static void toXContent(MetaData metaData, XContentBuilder builder, ToXContent.Params params) throws IOException { - boolean globalPersistentOnly = params.paramAsBoolean(GLOBAL_PERSISTENT_ONLY_PARAM, false); + boolean globalOnly = params.paramAsBoolean(GLOBAL_ONLY_PARAM, false); + boolean persistentOnly = params.paramAsBoolean(PERSISTENT_ONLY_PARAM, false); builder.startObject("meta-data"); builder.field("version", metaData.version()); @@ -1245,7 +1248,7 @@ public class MetaData implements Iterable { builder.endObject(); } - if (!globalPersistentOnly && !metaData.transientSettings().getAsMap().isEmpty()) { + if (!persistentOnly && !metaData.transientSettings().getAsMap().isEmpty()) { builder.startObject("transient_settings"); for (Map.Entry entry : metaData.transientSettings().getAsMap().entrySet()) { builder.field(entry.getKey(), entry.getValue()); @@ -1259,7 +1262,7 @@ public class MetaData implements Iterable { } builder.endObject(); - if (!globalPersistentOnly && !metaData.indices().isEmpty()) { + if (!globalOnly && !metaData.indices().isEmpty()) { builder.startObject("indices"); for (IndexMetaData indexMetaData : metaData) { IndexMetaData.Builder.toXContent(indexMetaData, builder, params); @@ -1269,7 +1272,7 @@ public class MetaData implements Iterable { for (ObjectObjectCursor cursor : metaData.customs()) { Custom.Factory factory = lookupFactorySafe(cursor.key); - if (!globalPersistentOnly || factory.isPersistent()) { + if (!persistentOnly || factory.isPersistent()) { builder.startObject(cursor.key); factory.toXContent(cursor.value, builder, params); builder.endObject(); diff --git a/src/main/java/org/elasticsearch/gateway/local/state/meta/LocalGatewayMetaState.java b/src/main/java/org/elasticsearch/gateway/local/state/meta/LocalGatewayMetaState.java index 5e74769adc1..93a2d10d4f5 100644 --- a/src/main/java/org/elasticsearch/gateway/local/state/meta/LocalGatewayMetaState.java +++ b/src/main/java/org/elasticsearch/gateway/local/state/meta/LocalGatewayMetaState.java @@ -132,12 +132,14 @@ public class LocalGatewayMetaState extends AbstractComponent implements ClusterS formatParams = new ToXContent.MapParams(params); Map globalOnlyParams = Maps.newHashMap(); globalOnlyParams.put("binary", "true"); - globalOnlyParams.put(MetaData.GLOBAL_PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.GLOBAL_ONLY_PARAM, "true"); globalOnlyFormatParams = new ToXContent.MapParams(globalOnlyParams); } else { formatParams = ToXContent.EMPTY_PARAMS; Map globalOnlyParams = Maps.newHashMap(); - globalOnlyParams.put(MetaData.GLOBAL_PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.GLOBAL_ONLY_PARAM, "true"); globalOnlyFormatParams = new ToXContent.MapParams(globalOnlyParams); } diff --git a/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 73b337f6dd1..c44ab076e41 100644 --- a/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -137,7 +137,8 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent globalOnlyParams = Maps.newHashMap(); - globalOnlyParams.put(MetaData.GLOBAL_PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.PERSISTENT_ONLY_PARAM, "true"); + globalOnlyParams.put(MetaData.GLOBAL_ONLY_PARAM, "true"); globalOnlyFormatParams = new ToXContent.MapParams(globalOnlyParams); snapshotRateLimiter = getRateLimiter(repositorySettings, "max_snapshot_bytes_per_sec", new ByteSizeValue(20, ByteSizeUnit.MB)); restoreRateLimiter = getRateLimiter(repositorySettings, "max_restore_bytes_per_sec", new ByteSizeValue(20, ByteSizeUnit.MB));