Skip to content

Commit f95de5c

Browse files
author
Sachin Kale
committed
Change name of the current setting to include ENABLED suffix
Signed-off-by: Sachin Kale <kalsac@amazon.com>
1 parent 8ffcf35 commit f95de5c

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ public Iterator<Setting<?>> settings() {
283283
Property.Final
284284
);
285285

286-
public static final String SETTING_REMOTE_STORE = "index.remote_store.enabled";
286+
public static final String SETTING_REMOTE_STORE_ENABLED = "index.remote_store.enabled";
287287
/**
288288
* Used to specify if the index data should be persisted in the remote store.
289289
*/
290-
public static final Setting<Boolean> INDEX_REMOTE_STORE_SETTING = Setting.boolSetting(
291-
SETTING_REMOTE_STORE,
290+
public static final Setting<Boolean> INDEX_REMOTE_STORE_ENABLED_SETTING = Setting.boolSetting(
291+
SETTING_REMOTE_STORE_ENABLED,
292292
false,
293293
Property.IndexScope,
294294
Property.Final

server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
222222
FeatureFlags.REPLICATION_TYPE,
223223
IndexMetadata.INDEX_REPLICATION_TYPE_SETTING,
224224
FeatureFlags.REMOTE_STORE,
225-
IndexMetadata.INDEX_REMOTE_STORE_SETTING
225+
IndexMetadata.INDEX_REMOTE_STORE_ENABLED_SETTING
226226
);
227227

228228
public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, BUILT_IN_INDEX_SETTINGS);

server/src/main/java/org/opensearch/index/IndexSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
718718
this.indexMetadata = indexMetadata;
719719
numberOfShards = settings.getAsInt(IndexMetadata.SETTING_NUMBER_OF_SHARDS, null);
720720
replicationType = ReplicationType.parseString(settings.get(IndexMetadata.SETTING_REPLICATION_TYPE));
721-
isRemoteStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_STORE, false);
721+
isRemoteStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, false);
722722

723723
this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings);
724724
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);

server/src/main/java/org/opensearch/snapshots/RestoreService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
117117
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_VERSION_CREATED;
118118
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_VERSION_UPGRADED;
119-
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE;
119+
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE_ENABLED;
120120
import static org.opensearch.common.util.set.Sets.newHashSet;
121121
import static org.opensearch.snapshots.SnapshotUtils.filterIndices;
122122

@@ -227,7 +227,7 @@ public ClusterState execute(ClusterState currentState) {
227227
logger.warn("Remote store restore is not supported for non-existent index. Skipping: {}", index);
228228
continue;
229229
}
230-
if (currentIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE, false)) {
230+
if (currentIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false)) {
231231
if (currentIndexMetadata.getState() != IndexMetadata.State.CLOSE) {
232232
throw new IllegalStateException(
233233
"cannot restore index ["

server/src/test/java/org/opensearch/index/IndexSettingsTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ public void testRemoteStoreExplicitSetting() {
770770
"index",
771771
Settings.builder()
772772
.put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)
773-
.put(IndexMetadata.SETTING_REMOTE_STORE, true)
773+
.put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true)
774774
.build()
775775
);
776776
IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY);
@@ -784,12 +784,12 @@ public void testUpdateRemoteStoreFails() {
784784
IllegalArgumentException error = expectThrows(
785785
IllegalArgumentException.class,
786786
() -> settings.updateSettings(
787-
Settings.builder().put("index.remote_store", randomBoolean()).build(),
787+
Settings.builder().put("index.remote_store.enabled", randomBoolean()).build(),
788788
Settings.builder(),
789789
Settings.builder(),
790790
"index"
791791
)
792792
);
793-
assertEquals(error.getMessage(), "final index setting [index.remote_store], not updateable");
793+
assertEquals(error.getMessage(), "final index setting [index.remote_store.enabled], not updateable");
794794
}
795795
}

server/src/test/java/org/opensearch/index/shard/IndexShardTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ public void restoreShard(
26602660
public void testRestoreShardFromRemoteStore() throws IOException {
26612661
IndexShard target = newStartedShard(
26622662
true,
2663-
Settings.builder().put(IndexMetadata.SETTING_REMOTE_STORE, true).build(),
2663+
Settings.builder().put(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, true).build(),
26642664
new InternalEngineFactory()
26652665
);
26662666

0 commit comments

Comments
 (0)