From 4354e2523ca05da1a50091ba05f53af93be553b9 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Thu, 31 Aug 2023 17:05:15 -0700 Subject: [PATCH] Address review comments Signed-off-by: Suraj Singh --- .../indices/replication/SegmentReplicationTarget.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java index 8981557006e29..d9b44da657805 100644 --- a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java +++ b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java @@ -186,7 +186,7 @@ private List getFiles(CheckpointInfoResponse checkpointInfo) state.setStage(SegmentReplicationState.Stage.FILE_DIFF); final Store.RecoveryDiff diff = Store.segmentReplicationDiff(checkpointInfo.getMetadataMap(), indexShard.getSegmentMetadataMap()); // local files - final Set localFiles = new HashSet<>(List.of(store.directory().listAll())); + final Set localFiles = Set.of(indexShard.store().directory().listAll()); // set of local files that can be reused final Set reuseFiles = diff.missing.stream() .filter(storeFileMetadata -> localFiles.contains(storeFileMetadata.name()))