Skip to content

Commit 2275cd8

Browse files
tlrxmasseyke
authored andcommitted
Move some constants from SearchableSnapshotsConstants to server (elastic#75308)
Elasticsearch's server sometimes has to do things differently in order to handle searchable snapshots shards. In such cases it relies on index settings and hard coded values to know if a shard is a searchable snapshot one. This commit adds a new SearchableSnapshotsSettings class in server that provides methods to check if an index is a searchable snapshot index. This class also contains the names of some index settings related to searchable snapshots that are required by the server.
1 parent e7feb47 commit 2275cd8

File tree

50 files changed

+201
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+201
-205
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadataVerifier.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import java.util.Map;
3434
import java.util.Set;
3535

36+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex;
37+
3638
/**
3739
* This service is responsible for verifying index metadata when an index is introduced
3840
* to the cluster, for example when restarting nodes, importing dangling indices, or restoring
@@ -202,7 +204,7 @@ IndexMetadata archiveBrokenIndexSettings(IndexMetadata indexMetadata) {
202204
IndexMetadata convertSharedCacheTierPreference(IndexMetadata indexMetadata) {
203205
final Settings settings = indexMetadata.getSettings();
204206
// Only remove these settings for a shared_cache searchable snapshot
205-
if ("snapshot".equals(settings.get("index.store.type", "")) && settings.getAsBoolean("index.store.snapshot.partial", false)) {
207+
if (isPartialSearchableSnapshotIndex(settings)) {
206208
final Settings.Builder settingsBuilder = Settings.builder().put(settings);
207209
// Clear any allocation rules other than preference for tier
208210
settingsBuilder.remove("index.routing.allocation.include._tier");

server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
import static org.elasticsearch.cluster.metadata.MetadataIndexTemplateService.resolveSettings;
104104
import static org.elasticsearch.index.IndexModule.INDEX_RECOVERY_TYPE_SETTING;
105105
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
106+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isSearchableSnapshotStore;
106107

107108
/**
108109
* Service responsible for submitting create index requests
@@ -1080,7 +1081,7 @@ private static List<String> validateIndexCustomPath(Settings settings, @Nullable
10801081
*/
10811082
static List<String> validateShrinkIndex(ClusterState state, String sourceIndex, String targetIndexName, Settings targetIndexSettings) {
10821083
IndexMetadata sourceMetadata = validateResize(state, sourceIndex, targetIndexName, targetIndexSettings);
1083-
if ("snapshot".equals(INDEX_STORE_TYPE_SETTING.get(sourceMetadata.getSettings()))) {
1084+
if (isSearchableSnapshotStore(sourceMetadata.getSettings())) {
10841085
throw new IllegalArgumentException("can't shrink searchable snapshot index [" + sourceIndex + ']');
10851086
}
10861087
assert INDEX_NUMBER_OF_SHARDS_SETTING.exists(targetIndexSettings);
@@ -1114,15 +1115,15 @@ static List<String> validateShrinkIndex(ClusterState state, String sourceIndex,
11141115

11151116
static void validateSplitIndex(ClusterState state, String sourceIndex, String targetIndexName, Settings targetIndexSettings) {
11161117
IndexMetadata sourceMetadata = validateResize(state, sourceIndex, targetIndexName, targetIndexSettings);
1117-
if ("snapshot".equals(INDEX_STORE_TYPE_SETTING.get(sourceMetadata.getSettings()))) {
1118+
if (isSearchableSnapshotStore(sourceMetadata.getSettings())) {
11181119
throw new IllegalArgumentException("can't split searchable snapshot index [" + sourceIndex + ']');
11191120
}
11201121
IndexMetadata.selectSplitShard(0, sourceMetadata, INDEX_NUMBER_OF_SHARDS_SETTING.get(targetIndexSettings));
11211122
}
11221123

11231124
static void validateCloneIndex(ClusterState state, String sourceIndex, String targetIndexName, Settings targetIndexSettings) {
11241125
IndexMetadata sourceMetadata = validateResize(state, sourceIndex, targetIndexName, targetIndexSettings);
1125-
if ("snapshot".equals(INDEX_STORE_TYPE_SETTING.get(sourceMetadata.getSettings()))) {
1126+
if (isSearchableSnapshotStore(sourceMetadata.getSettings())) {
11261127
for (Setting<?> nonCloneableSetting : Arrays.asList(INDEX_STORE_TYPE_SETTING, INDEX_RECOVERY_TYPE_SETTING)) {
11271128
if (nonCloneableSetting.exists(targetIndexSettings) == false) {
11281129
throw new IllegalArgumentException("can't clone searchable snapshot index [" + sourceIndex + "]; setting ["

server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
import java.util.stream.Stream;
6060

6161
import static java.util.Collections.unmodifiableMap;
62-
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
62+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOTS_REPOSITORY_NAME_SETTING_KEY;
63+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOTS_REPOSITORY_UUID_SETTING_KEY;
64+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isSearchableSnapshotStore;
6365

6466
/**
6567
* Service responsible for maintaining and providing access to snapshot repositories on nodes.
@@ -81,9 +83,6 @@ public class RepositoriesService extends AbstractLifecycleComponent implements C
8183
Setting.Property.NodeScope
8284
);
8385

84-
public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_NAME_SETTING_KEY = "index.store.snapshot.repository_name";
85-
public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_UUID_SETTING_KEY = "index.store.snapshot.repository_uuid";
86-
8786
private final Map<String, Repository.Factory> typesRegistry;
8887
private final Map<String, Repository.Factory> internalTypesRegistry;
8988

@@ -738,7 +737,7 @@ private static void ensureNoSearchableSnapshotsIndicesInUse(ClusterState cluster
738737
}
739738

740739
private static boolean indexSettingsMatchRepositoryMetadata(Settings indexSettings, RepositoryMetadata repositoryMetadata) {
741-
if ("snapshot".equals(INDEX_STORE_TYPE_SETTING.get(indexSettings))) {
740+
if (isSearchableSnapshotStore(indexSettings)) {
742741
final String indexRepositoryUuid = indexSettings.get(SEARCHABLE_SNAPSHOTS_REPOSITORY_UUID_SETTING_KEY);
743742
if (Strings.hasLength(indexRepositoryUuid)) {
744743
return Objects.equals(repositoryMetadata.uuid(), indexRepositoryUuid);

server/src/main/java/org/elasticsearch/repositories/blobstore/FileRestoreContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import static java.util.Collections.emptyMap;
3434
import static java.util.Collections.unmodifiableMap;
35-
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
35+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isSearchableSnapshotStore;
3636

3737
/**
3838
* This context will execute a file restore of the lucene files. It is primarily designed to be used to
@@ -175,8 +175,7 @@ public void restore(SnapshotFiles snapshotFiles, Store store, ActionListener<Voi
175175

176176
private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMetadata restoredSegmentsFile) {
177177
try {
178-
final String indexStoreType = INDEX_STORE_TYPE_SETTING.get(store.indexSettings().getSettings());
179-
if ("snapshot".equals(indexStoreType) == false) {
178+
if (isSearchableSnapshotStore(store.indexSettings().getSettings())) {
180179
Lucene.pruneUnreferencedFiles(restoredSegmentsFile.name(), store.directory());
181180
}
182181
} catch (IOException e) {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
package org.elasticsearch.snapshots;
10+
11+
import org.elasticsearch.common.settings.Settings;
12+
13+
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
14+
15+
public final class SearchableSnapshotsSettings {
16+
17+
public static final String SEARCHABLE_SNAPSHOT_STORE_TYPE = "snapshot";
18+
public static final String SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY = "index.store.snapshot.partial";
19+
public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_NAME_SETTING_KEY = "index.store.snapshot.repository_name";
20+
public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_UUID_SETTING_KEY = "index.store.snapshot.repository_uuid";
21+
22+
private SearchableSnapshotsSettings() {}
23+
24+
public static boolean isSearchableSnapshotStore(Settings indexSettings) {
25+
return SEARCHABLE_SNAPSHOT_STORE_TYPE.equals(INDEX_STORE_TYPE_SETTING.get(indexSettings));
26+
}
27+
28+
public static boolean isPartialSearchableSnapshotIndex(Settings indexSettings) {
29+
return isSearchableSnapshotStore(indexSettings) && indexSettings.getAsBoolean(SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY, false);
30+
}
31+
}

x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import java.util.Objects;
2222

23+
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE;
2324
import static org.hamcrest.Matchers.is;
2425

2526
public class FrozenUtilsTests extends AutoscalingTestCase {
@@ -46,7 +47,7 @@ public static Settings indexSettings(String tierPreference) {
4647
// pass setting validator.
4748
if (Objects.equals(tierPreference, DataTier.DATA_FROZEN)) {
4849
settings.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true)
49-
.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsConstants.SNAPSHOT_DIRECTORY_FACTORY_KEY);
50+
.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE);
5051
}
5152
return settings.build();
5253
}

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package org.elasticsearch.xpack.ccr.action;
88

99
import com.carrotsearch.hppc.predicates.ObjectPredicate;
10+
1011
import org.apache.logging.log4j.LogManager;
1112
import org.apache.logging.log4j.Logger;
1213
import org.apache.logging.log4j.message.ParameterizedMessage;
@@ -27,16 +28,17 @@
2728
import org.elasticsearch.cluster.routing.IndexRoutingTable;
2829
import org.elasticsearch.cluster.service.ClusterService;
2930
import org.elasticsearch.common.collect.CopyOnWriteHashMap;
30-
import org.elasticsearch.core.Tuple;
3131
import org.elasticsearch.common.component.AbstractLifecycleComponent;
3232
import org.elasticsearch.common.component.Lifecycle;
3333
import org.elasticsearch.common.settings.Settings;
34-
import org.elasticsearch.core.TimeValue;
3534
import org.elasticsearch.common.util.concurrent.AtomicArray;
3635
import org.elasticsearch.common.util.concurrent.CountDown;
36+
import org.elasticsearch.core.TimeValue;
37+
import org.elasticsearch.core.Tuple;
3738
import org.elasticsearch.index.Index;
3839
import org.elasticsearch.index.IndexSettings;
3940
import org.elasticsearch.license.LicenseUtils;
41+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
4042
import org.elasticsearch.transport.NoSuchRemoteClusterException;
4143
import org.elasticsearch.xpack.ccr.Ccr;
4244
import org.elasticsearch.xpack.ccr.CcrLicenseChecker;
@@ -45,7 +47,6 @@
4547
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern;
4648
import org.elasticsearch.xpack.core.ccr.AutoFollowStats;
4749
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
48-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
4950

5051
import java.util.ArrayList;
5152
import java.util.Collections;
@@ -521,7 +522,7 @@ private void checkAutoFollowPattern(String autoFollowPattenName,
521522
}
522523
groupedListener.onResponse(new Tuple<>(indexToFollow, failure));
523524
});
524-
} else if (SearchableSnapshotsConstants.isSearchableSnapshotStore(leaderIndexSettings)) {
525+
} else if (SearchableSnapshotsSettings.isSearchableSnapshotStore(leaderIndexSettings)) {
525526
String message = String.format(Locale.ROOT,
526527
"index to follow [%s] is a searchable snapshot index and cannot be used for cross-cluster replication purpose",
527528
indexToFollow.getName()

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportPutFollowAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.elasticsearch.license.LicenseUtils;
3636
import org.elasticsearch.snapshots.RestoreInfo;
3737
import org.elasticsearch.snapshots.RestoreService;
38+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
3839
import org.elasticsearch.tasks.Task;
3940
import org.elasticsearch.threadpool.ThreadPool;
4041
import org.elasticsearch.transport.TransportService;
@@ -44,7 +45,6 @@
4445
import org.elasticsearch.xpack.core.ccr.action.FollowParameters;
4546
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
4647
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
47-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
4848

4949
import java.util.ArrayList;
5050
import java.util.Comparator;
@@ -129,7 +129,7 @@ private void createFollowerIndex(
129129
"] does not have soft deletes enabled"));
130130
return;
131131
}
132-
if (SearchableSnapshotsConstants.isSearchableSnapshotStore(leaderIndexMetadata.getSettings())) {
132+
if (SearchableSnapshotsSettings.isSearchableSnapshotStore(leaderIndexMetadata.getSettings())) {
133133
listener.onFailure(new IllegalArgumentException("leader index [" + request.getLeaderIndex() +
134134
"] is a searchable snapshot index and cannot be used as a leader index for cross-cluster replication purpose"));
135135
return;

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportResumeFollowAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.elasticsearch.indices.IndicesService;
4343
import org.elasticsearch.license.LicenseUtils;
4444
import org.elasticsearch.persistent.PersistentTasksService;
45+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
4546
import org.elasticsearch.tasks.Task;
4647
import org.elasticsearch.threadpool.ThreadPool;
4748
import org.elasticsearch.transport.TransportService;
@@ -52,7 +53,6 @@
5253
import org.elasticsearch.xpack.core.ccr.action.FollowParameters;
5354
import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction;
5455
import org.elasticsearch.xpack.core.ccr.action.ShardFollowTask;
55-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
5656

5757
import java.io.IOException;
5858
import java.util.Iterator;
@@ -207,15 +207,15 @@ static void validate(
207207
throw new IllegalArgumentException("leader index [" + leaderIndex.getIndex().getName() +
208208
"] does not have soft deletes enabled");
209209
}
210-
if (SearchableSnapshotsConstants.isSearchableSnapshotStore(leaderIndex.getSettings())) {
210+
if (SearchableSnapshotsSettings.isSearchableSnapshotStore(leaderIndex.getSettings())) {
211211
throw new IllegalArgumentException("leader index [" + leaderIndex.getIndex().getName() +
212212
"] is a searchable snapshot index and cannot be used for cross-cluster replication purpose");
213213
}
214214
if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(followIndex.getSettings()) == false) {
215215
throw new IllegalArgumentException("follower index [" + request.getFollowerIndex() +
216216
"] does not have soft deletes enabled");
217217
}
218-
if (SearchableSnapshotsConstants.isSearchableSnapshotStore(followIndex.getSettings())) {
218+
if (SearchableSnapshotsSettings.isSearchableSnapshotStore(followIndex.getSettings())) {
219219
throw new IllegalArgumentException("follower index [" + request.getFollowerIndex() +
220220
"] is a searchable snapshot index and cannot be used for cross-cluster replication purpose");
221221
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.elasticsearch.xpack.cluster.routing.allocation;
99

1010
import com.carrotsearch.hppc.cursors.ObjectCursor;
11+
1112
import org.elasticsearch.cluster.metadata.IndexMetadata;
1213
import org.elasticsearch.cluster.node.DiscoveryNode;
1314
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
@@ -21,6 +22,7 @@
2122
import org.elasticsearch.common.settings.Setting;
2223
import org.elasticsearch.common.settings.Settings;
2324
import org.elasticsearch.index.IndexModule;
25+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
2426
import org.elasticsearch.xpack.core.DataTier;
2527
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
2628

@@ -67,7 +69,7 @@ private static class DataTierValidator implements Setting.Validator<String> {
6769
SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING);
6870

6971
public static String getDefaultTierPreference(Settings settings) {
70-
if (SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex(settings)) {
72+
if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(settings)) {
7173
return DATA_FROZEN;
7274
} else {
7375
return "";

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.cluster.node.DiscoveryNodes;
2222
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
2323
import org.elasticsearch.cluster.service.ClusterService;
24-
import org.elasticsearch.core.Booleans;
2524
import org.elasticsearch.common.inject.Binder;
2625
import org.elasticsearch.common.inject.multibindings.Multibinder;
2726
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@@ -34,6 +33,7 @@
3433
import org.elasticsearch.common.settings.SettingsFilter;
3534
import org.elasticsearch.common.util.BigArrays;
3635
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
36+
import org.elasticsearch.core.Booleans;
3737
import org.elasticsearch.env.Environment;
3838
import org.elasticsearch.env.NodeEnvironment;
3939
import org.elasticsearch.index.IndexSettings;
@@ -58,6 +58,7 @@
5858
import org.elasticsearch.rest.RestController;
5959
import org.elasticsearch.rest.RestHandler;
6060
import org.elasticsearch.script.ScriptService;
61+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
6162
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
6263
import org.elasticsearch.threadpool.ThreadPool;
6364
import org.elasticsearch.watcher.ResourceWatcherService;
@@ -82,12 +83,11 @@
8283
import org.elasticsearch.xpack.core.ssl.SSLConfiguration;
8384
import org.elasticsearch.xpack.core.ssl.SSLConfigurationReloader;
8485
import org.elasticsearch.xpack.core.ssl.SSLService;
85-
import org.elasticsearch.xpack.core.transform.TransformMetadata;
8686
import org.elasticsearch.xpack.core.termsenum.action.TermsEnumAction;
8787
import org.elasticsearch.xpack.core.termsenum.action.TransportTermsEnumAction;
8888
import org.elasticsearch.xpack.core.termsenum.rest.RestTermsEnumAction;
89+
import org.elasticsearch.xpack.core.transform.TransformMetadata;
8990
import org.elasticsearch.xpack.core.watcher.WatcherMetadata;
90-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
9191

9292
import java.nio.file.Files;
9393
import java.nio.file.Path;
@@ -373,7 +373,7 @@ public Map<String, Repository.Factory> getRepositories(Environment env, NamedXCo
373373
@Override
374374
public Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings) {
375375
if (indexSettings.getValue(SourceOnlySnapshotRepository.SOURCE_ONLY) &&
376-
SearchableSnapshotsConstants.isSearchableSnapshotStore(indexSettings.getSettings()) == false) {
376+
SearchableSnapshotsSettings.isSearchableSnapshotStore(indexSettings.getSettings()) == false) {
377377
return Optional.of(SourceOnlySnapshotRepository.getEngineFactory());
378378
}
379379

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
import org.apache.logging.log4j.LogManager;
1010
import org.apache.logging.log4j.Logger;
1111
import org.elasticsearch.client.Client;
12-
import org.elasticsearch.common.xcontent.ParseField;
1312
import org.elasticsearch.common.Strings;
1413
import org.elasticsearch.common.io.stream.StreamInput;
1514
import org.elasticsearch.common.io.stream.StreamOutput;
1615
import org.elasticsearch.common.settings.Settings;
1716
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
17+
import org.elasticsearch.common.xcontent.ParseField;
1818
import org.elasticsearch.common.xcontent.XContentBuilder;
1919
import org.elasticsearch.common.xcontent.XContentParser;
20+
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
2021
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;
2122
import org.elasticsearch.xpack.core.DataTier;
2223
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
23-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
2424

2525
import java.io.IOException;
2626
import java.util.List;
@@ -106,7 +106,7 @@ public List<Step> toSteps(Client client, String phase, StepKey nextStepKey) {
106106
Settings indexSettings = clusterState.metadata().index(index).getSettings();
107107

108108
// partially mounted indices will already have data_frozen, and we don't want to change that if they do
109-
if (SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex(indexSettings)) {
109+
if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(indexSettings)) {
110110
String policyName = LifecycleSettings.LIFECYCLE_NAME_SETTING.get(indexSettings);
111111
logger.debug("[{}] action in policy [{}] is configured for index [{}] which is a partially mounted index. " +
112112
"skipping this action", MigrateAction.NAME, policyName, index.getName());

0 commit comments

Comments
 (0)