Skip to content

Commit 6f50c92

Browse files
committed
Fix stuff after cherry-picking
1 parent f108eb1 commit 6f50c92

File tree

20 files changed

+85
-62
lines changed

20 files changed

+85
-62
lines changed

test/framework/src/main/java/org/elasticsearch/common/lucene/store/ESIndexInputTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ESIndexInputTestCase extends ESTestCase {
4343
@BeforeClass
4444
public static void createExecutor() {
4545
final String name = "TEST-" + getTestClass().getSimpleName() + "#randomReadAndSlice";
46-
executor = EsExecutors.newFixed(name, 10, 0, EsExecutors.daemonThreadFactory(name), new ThreadContext(Settings.EMPTY), false);
46+
executor = EsExecutors.newFixed(name, 10, 0, EsExecutors.daemonThreadFactory(name), new ThreadContext(Settings.EMPTY));
4747
}
4848

4949
@AfterClass

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void performDuringNoSnapshot(IndexMetadata indexMetadata, ClusterState currentCl
5050
return;
5151
}
5252
DeleteSnapshotRequest deleteSnapshotRequest = new DeleteSnapshotRequest(repositoryName, snapshotName);
53-
getClient().admin().cluster().deleteSnapshot(deleteSnapshotRequest, new ActionListener<>() {
53+
getClient().admin().cluster().deleteSnapshot(deleteSnapshotRequest, new ActionListener<AcknowledgedResponse>() {
5454

5555
@Override
5656
public void onResponse(AcknowledgedResponse acknowledgedResponse) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public DeleteAction(boolean deleteSearchableSnapshot) {
5050
}
5151

5252
public DeleteAction(StreamInput in) throws IOException {
53-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
53+
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
5454
this.deleteSearchableSnapshot = in.readBoolean();
5555
} else {
5656
this.deleteSearchableSnapshot = true;
@@ -59,7 +59,7 @@ public DeleteAction(StreamInput in) throws IOException {
5959

6060
@Override
6161
public void writeTo(StreamOutput out) throws IOException {
62-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
62+
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
6363
out.writeBoolean(deleteSearchableSnapshot);
6464
}
6565
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public IndexLifecycleExplainResponse(StreamInput in) throws IOException {
194194
isAutoRetryableError = null;
195195
failedStepRetryCount = null;
196196
}
197-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
197+
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
198198
repositoryName = in.readOptionalString();
199199
snapshotName = in.readOptionalString();
200200
} else {
@@ -240,7 +240,7 @@ public void writeTo(StreamOutput out) throws IOException {
240240
out.writeOptionalBoolean(isAutoRetryableError);
241241
out.writeOptionalVInt(failedStepRetryCount);
242242
}
243-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
243+
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
244244
out.writeOptionalString(repositoryName);
245245
out.writeOptionalString(snapshotName);
246246
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public class MountSearchableSnapshotRequest extends MasterNodeRequest<MountSearc
3333
public static final ConstructingObjectParser<MountSearchableSnapshotRequest, RestRequest> PARSER = new ConstructingObjectParser<>(
3434
"mount_searchable_snapshot", true,
3535
(a, request) -> new MountSearchableSnapshotRequest(
36-
Objects.requireNonNullElse((String)a[1], (String)a[0]),
36+
(String) ((a[1] != null) ? a[1] : Objects.requireNonNull(a[0])),
3737
request.param("repository"),
3838
request.param("snapshot"),
39-
(String)a[0],
40-
Objects.requireNonNullElse((Settings)a[2], Settings.EMPTY),
41-
Objects.requireNonNullElse((String[])a[3], Strings.EMPTY_ARRAY),
39+
(String) a[0],
40+
(Settings) ((a[2] != null) ? a[2] : Settings.EMPTY),
41+
(String[]) ((a[3] != null) ? a[3] : Strings.EMPTY_ARRAY),
4242
request.paramAsBoolean("wait_for_completion", false)));
4343

4444
private static final ParseField INDEX_FIELD = new ParseField("index");

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/CleanupSnapshotStepTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void onFailure(Exception e) {
8888
IndexMetadata.Builder indexMetadataBuilder =
8989
IndexMetadata.builder(indexName).settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName))
9090
.numberOfShards(randomIntBetween(1, 5)).numberOfReplicas(randomIntBetween(0, 5));
91-
Map<String, String> ilmCustom = Map.of("snapshot_repository", "repository_name");
91+
Map<String, String> ilmCustom = org.elasticsearch.common.collect.Map.of("snapshot_repository", "repository_name");
9292
indexMetadataBuilder.putCustom(LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY, ilmCustom);
9393

9494
IndexMetadata indexMetaData = indexMetadataBuilder.build();
@@ -116,7 +116,7 @@ public void testPerformAction() {
116116
String indexName = randomAlphaOfLength(10);
117117
String policyName = "test-ilm-policy";
118118
String snapshotName = indexName + "-" + policyName;
119-
Map<String, String> ilmCustom = Map.of("snapshot_name", snapshotName);
119+
Map<String, String> ilmCustom = org.elasticsearch.common.collect.Map.of("snapshot_name", snapshotName);
120120

121121
IndexMetadata.Builder indexMetadataBuilder =
122122
IndexMetadata.builder(indexName).settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName))

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStepTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
2222

2323
import java.util.HashMap;
24-
import java.util.List;
2524
import java.util.Map;
2625

26+
import static java.util.Collections.emptyList;
2727
import static org.elasticsearch.xpack.core.ilm.AbstractStepMasterTimeoutTestCase.emptyClusterState;
2828
import static org.hamcrest.Matchers.instanceOf;
2929
import static org.hamcrest.Matchers.is;
@@ -179,7 +179,7 @@ public void testResponseStatusHandling() {
179179
ClusterState.builder(emptyClusterState()).metadata(Metadata.builder().put(indexMetaData, true).build()).build();
180180

181181
{
182-
RestoreSnapshotResponse responseWithOKStatus = new RestoreSnapshotResponse(new RestoreInfo("test", List.of(), 1, 1));
182+
RestoreSnapshotResponse responseWithOKStatus = new RestoreSnapshotResponse(new RestoreInfo("test", emptyList(), 1, 1));
183183
try (NoOpClient clientPropagatingOKResponse = getClientTriggeringResponse(responseWithOKStatus)) {
184184
MountSnapshotStep step = new MountSnapshotStep(randomStepKey(), randomStepKey(), clientPropagatingOKResponse,
185185
RESTORED_INDEX_PREFIX);

x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ public void testDeleteActionDeletesSearchableSnapshot() throws Exception {
15931593

15941594
// create policy with cold and delete phases
15951595
Map<String, LifecycleAction> coldActions =
1596-
Map.of(SearchableSnapshotAction.NAME, new SearchableSnapshotAction(snapshotRepo));
1596+
singletonMap(SearchableSnapshotAction.NAME, new SearchableSnapshotAction(snapshotRepo));
15971597
Map<String, Phase> phases = new HashMap<>();
15981598
phases.put("cold", new Phase("cold", TimeValue.ZERO, coldActions));
15991599
phases.put("delete", new Phase("delete", TimeValue.timeValueMillis(10000), singletonMap(DeleteAction.NAME,
@@ -1649,7 +1649,7 @@ public void testDeleteActionDoesntDeleteSearchableSnapshot() throws Exception {
16491649

16501650
// create policy with cold and delete phases
16511651
Map<String, LifecycleAction> coldActions =
1652-
Map.of(SearchableSnapshotAction.NAME, new SearchableSnapshotAction(snapshotRepo));
1652+
singletonMap(SearchableSnapshotAction.NAME, new SearchableSnapshotAction(snapshotRepo));
16531653
Map<String, Phase> phases = new HashMap<>();
16541654
phases.put("cold", new Phase("cold", TimeValue.ZERO, coldActions));
16551655
phases.put("delete", new Phase("delete", TimeValue.timeValueMillis(10000), singletonMap(DeleteAction.NAME,

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/SearchableSnapshotDirectory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public BlobStoreIndexShardSnapshot snapshot() {
174174

175175
private List<BlobStoreIndexShardSnapshot.FileInfo> files() {
176176
if (loaded == false) {
177-
return List.of();
177+
return Collections.emptyList();
178178
}
179179
final List<BlobStoreIndexShardSnapshot.FileInfo> files = snapshot().indexFiles();
180180
assert files != null;

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
import java.util.function.Function;
6767
import java.util.function.Supplier;
6868

69+
import static java.util.Arrays.asList;
70+
import static java.util.Collections.emptyList;
71+
import static java.util.Collections.emptyMap;
72+
import static java.util.Collections.singletonList;
73+
import static java.util.Collections.singletonMap;
74+
import static java.util.Collections.unmodifiableList;
6975
import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING;
7076

7177
/**
@@ -118,7 +124,7 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Rep
118124
// The file extensions that are excluded from the cache
119125
public static final Setting<List<String>> SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING = Setting.listSetting(
120126
"index.store.snapshot.cache.excluded_file_types",
121-
Collections.emptyList(),
127+
emptyList(),
122128
Function.identity(),
123129
Setting.Property.IndexScope,
124130
Setting.Property.NodeScope
@@ -151,19 +157,21 @@ public static void ensureValidLicense(XPackLicenseState licenseState) {
151157
@Override
152158
public List<Setting<?>> getSettings() {
153159
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
154-
return List.of(
155-
SNAPSHOT_REPOSITORY_SETTING,
156-
SNAPSHOT_SNAPSHOT_NAME_SETTING,
157-
SNAPSHOT_SNAPSHOT_ID_SETTING,
158-
SNAPSHOT_INDEX_ID_SETTING,
159-
SNAPSHOT_CACHE_ENABLED_SETTING,
160-
SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING,
161-
SNAPSHOT_UNCACHED_CHUNK_SIZE_SETTING,
162-
CacheService.SNAPSHOT_CACHE_SIZE_SETTING,
163-
CacheService.SNAPSHOT_CACHE_RANGE_SIZE_SETTING
160+
return unmodifiableList(
161+
asList(
162+
SNAPSHOT_REPOSITORY_SETTING,
163+
SNAPSHOT_SNAPSHOT_NAME_SETTING,
164+
SNAPSHOT_SNAPSHOT_ID_SETTING,
165+
SNAPSHOT_INDEX_ID_SETTING,
166+
SNAPSHOT_CACHE_ENABLED_SETTING,
167+
SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING,
168+
SNAPSHOT_UNCACHED_CHUNK_SIZE_SETTING,
169+
CacheService.SNAPSHOT_CACHE_SIZE_SETTING,
170+
CacheService.SNAPSHOT_CACHE_RANGE_SIZE_SETTING
171+
)
164172
);
165173
} else {
166-
return List.of();
174+
return emptyList();
167175
}
168176
}
169177

@@ -183,9 +191,9 @@ public Collection<Object> createComponents(
183191
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
184192
final CacheService cacheService = new CacheService(settings);
185193
this.cacheService.set(cacheService);
186-
return List.of(cacheService);
194+
return singletonList(cacheService);
187195
} else {
188-
return List.of();
196+
return emptyList();
189197
}
190198
}
191199

@@ -205,15 +213,15 @@ public void onIndexModule(IndexModule indexModule) {
205213
@Override
206214
public Map<String, DirectoryFactory> getDirectoryFactories() {
207215
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
208-
return Map.of(SNAPSHOT_DIRECTORY_FACTORY_KEY, (indexSettings, shardPath) -> {
216+
return singletonMap(SNAPSHOT_DIRECTORY_FACTORY_KEY, (indexSettings, shardPath) -> {
209217
final RepositoriesService repositories = repositoriesService.get();
210218
assert repositories != null;
211219
final CacheService cache = cacheService.get();
212220
assert cache != null;
213221
return SearchableSnapshotDirectory.create(repositories, cache, indexSettings, shardPath, System::nanoTime);
214222
});
215223
} else {
216-
return Map.of();
224+
return emptyMap();
217225
}
218226
}
219227

@@ -230,13 +238,13 @@ && isSearchableSnapshotStore(indexSettings.getSettings())
230238
@Override
231239
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
232240
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
233-
return List.of(
241+
return org.elasticsearch.common.collect.List.of(
234242
new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class),
235243
new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class),
236244
new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class)
237245
);
238246
} else {
239-
return List.of();
247+
return emptyList();
240248
}
241249
}
242250

@@ -250,13 +258,15 @@ public List<RestHandler> getRestHandlers(
250258
Supplier<DiscoveryNodes> nodesInCluster
251259
) {
252260
if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) {
253-
return List.of(
254-
new RestSearchableSnapshotsStatsAction(),
255-
new RestClearSearchableSnapshotsCacheAction(),
256-
new RestMountSearchableSnapshotAction()
261+
return unmodifiableList(
262+
asList(
263+
new RestSearchableSnapshotsStatsAction(),
264+
new RestClearSearchableSnapshotsCacheAction(),
265+
new RestMountSearchableSnapshotAction()
266+
)
257267
);
258268
} else {
259-
return List.of();
269+
return emptyList();
260270
}
261271
}
262272

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.elasticsearch.repositories.Repository;
3131
import org.elasticsearch.repositories.RepositoryData;
3232
import org.elasticsearch.snapshots.SnapshotId;
33-
import org.elasticsearch.tasks.Task;
3433
import org.elasticsearch.threadpool.ThreadPool;
3534
import org.elasticsearch.transport.TransportService;
3635
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
@@ -121,7 +120,6 @@ private static Settings buildIndexSettings(String repoName, SnapshotId snapshotI
121120

122121
@Override
123122
protected void masterOperation(
124-
Task task,
125123
final MountSearchableSnapshotRequest request,
126124
final ClusterState state,
127125
final ActionListener<RestoreSnapshotResponse> listener
@@ -148,7 +146,7 @@ protected void masterOperation(
148146
.stream()
149147
.filter(s -> snapName.equals(s.getName()))
150148
.findFirst();
151-
if (matchingSnapshotId.isEmpty()) {
149+
if (matchingSnapshotId.isPresent() == false) {
152150
throw new ElasticsearchException("snapshot [" + snapName + "] not found in repository [" + repoName + "]");
153151
}
154152
final SnapshotId snapshotId = matchingSnapshotId.get();

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/rest/RestClearSearchableSnapshotsCacheAction.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@
1616

1717
import java.util.List;
1818

19+
import static java.util.Arrays.asList;
20+
import static java.util.Collections.unmodifiableList;
21+
1922
public class RestClearSearchableSnapshotsCacheAction extends BaseRestHandler {
2023

2124
@Override
2225
public List<Route> routes() {
23-
return List.of(
24-
new Route(RestRequest.Method.POST, "/_searchable_snapshots/cache/clear"),
25-
new Route(RestRequest.Method.POST, "/{index}/_searchable_snapshots/cache/clear")
26+
return unmodifiableList(
27+
asList(
28+
new Route(RestRequest.Method.POST, "/_searchable_snapshots/cache/clear"),
29+
new Route(RestRequest.Method.POST, "/{index}/_searchable_snapshots/cache/clear")
30+
)
2631
);
2732
}
2833

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/rest/RestSearchableSnapshotsStatsAction.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515

1616
import java.util.List;
1717

18+
import static java.util.Arrays.asList;
19+
import static java.util.Collections.unmodifiableList;
20+
1821
public class RestSearchableSnapshotsStatsAction extends BaseRestHandler {
1922

2023
@Override
2124
public List<Route> routes() {
22-
return List.of(
23-
new Route(RestRequest.Method.GET, "/_searchable_snapshots/stats"),
24-
new Route(RestRequest.Method.GET, "/{index}/_searchable_snapshots/stats")
25+
return unmodifiableList(
26+
asList(
27+
new Route(RestRequest.Method.GET, "/_searchable_snapshots/stats"),
28+
new Route(RestRequest.Method.GET, "/{index}/_searchable_snapshots/stats")
29+
)
2530
);
2631
}
2732

x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryStatsTests.java

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

2727
import java.io.IOException;
2828
import java.nio.charset.StandardCharsets;
29+
import java.util.Collections;
2930
import java.util.List;
3031
import java.util.concurrent.atomic.AtomicLong;
3132
import java.util.function.LongSupplier;
@@ -566,7 +567,7 @@ private static void executeTestCase(
566567
final String blobName = randomUnicodeOfLength(10);
567568
final BlobContainer blobContainer = singleBlobContainer(blobName, fileContent);
568569
final StoreFileMetadata metadata = new StoreFileMetadata(fileName, fileContent.length, "_checksum", Version.CURRENT.luceneVersion);
569-
final List<FileInfo> files = List.of(new FileInfo(blobName, metadata, new ByteSizeValue(fileContent.length)));
570+
final List<FileInfo> files = Collections.singletonList(new FileInfo(blobName, metadata, new ByteSizeValue(fileContent.length)));
570571
final BlobStoreIndexShardSnapshot snapshot = new BlobStoreIndexShardSnapshot(snapshotId.getName(), 0L, files, 0L, 0L, 0, 0L);
571572

572573
try (

x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
import java.util.List;
9191
import java.util.Map;
9292

93+
import static java.util.Arrays.asList;
9394
import static java.util.Collections.emptyMap;
9495
import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING;
9596
import static org.hamcrest.Matchers.allOf;
@@ -153,7 +154,7 @@ public void testIndexSearcher() throws Exception {
153154
CheckHits.checkEqual(query, snapshotSearcher.search(query, 10).scoreDocs, searcher.search(query, 10).scoreDocs);
154155
}
155156
{
156-
Query query = new TermInSetQuery("text", List.of(new BytesRef("quick"), new BytesRef("lazy")));
157+
Query query = new TermInSetQuery("text", asList(new BytesRef("quick"), new BytesRef("lazy")));
157158
assertThat(snapshotSearcher.count(query), equalTo(searcher.count(query)));
158159
CheckHits.checkEqual(query, snapshotSearcher.search(query, 10).scoreDocs, searcher.search(query, 10).scoreDocs);
159160
}
@@ -328,7 +329,7 @@ private void testDirectories(final CheckedBiConsumer<Directory, Directory, Excep
328329
final IndexWriterConfig indexWriterConfig = newIndexWriterConfig();
329330
try (IndexWriter writer = new IndexWriter(directory, indexWriterConfig)) {
330331
final int nbDocs = scaledRandomIntBetween(0, 1_000);
331-
final List<String> words = List.of("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog");
332+
final List<String> words = asList("the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog");
332333
for (int i = 0; i < nbDocs; i++) {
333334
final Document doc = new Document();
334335
doc.add(new StringField("id", "" + i, Field.Store.YES));
@@ -460,7 +461,7 @@ protected void assertSnapshotOrGenericThread() {
460461

461462
private void testIndexInputs(final CheckedBiConsumer<IndexInput, IndexInput, Exception> consumer) throws Exception {
462463
testDirectories((directory, snapshotDirectory) -> {
463-
for (String fileName : randomSubsetOf(Arrays.asList(snapshotDirectory.listAll()))) {
464+
for (String fileName : randomSubsetOf(asList(snapshotDirectory.listAll()))) {
464465
final IOContext context = newIOContext(random());
465466
try (IndexInput indexInput = directory.openInput(fileName, context)) {
466467
final List<Closeable> closeables = new ArrayList<>();

0 commit comments

Comments
 (0)