diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index d0edb75e9cec3..f40cbb9fef9bc 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -5054,7 +5054,10 @@ public void syncSegmentsFromRemoteSegmentStore(boolean overrideLocal, final Runn .filter(file -> file.startsWith(RemoteSegmentStoreDirectory.SEGMENT_INFOS_SNAPSHOT_PREFIX)) .collect(Collectors.toList()); assert segmentInfosSnapshotFilenames.size() == 1; - try (ChecksumIndexInput segmentInfosInput = store.directory().openChecksumInput(segmentInfosSnapshotFilenames.get(0), IOContext.READ)) { + try ( + ChecksumIndexInput segmentInfosInput = store.directory() + .openChecksumInput(segmentInfosSnapshotFilenames.get(0), IOContext.READ) + ) { infosSnapshot = SegmentInfos.readCommit( store.directory(), segmentInfosInput, 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 3bbc124aae3a7..fc1341d7ffcd8 100644 --- a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java +++ b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationTarget.java @@ -302,7 +302,10 @@ private void finalizeReplication(CheckpointInfoResponse checkpointInfoResponse) .filter(file -> file.startsWith(RemoteSegmentStoreDirectory.SEGMENT_INFOS_SNAPSHOT_PREFIX)) .collect(Collectors.toList()); assert segmentInfosSnapshotFilenames.size() == 1; - try (ChecksumIndexInput segmentInfosInput = store.directory().openChecksumInput(segmentInfosSnapshotFilenames.get(0), IOContext.READ)) { + try ( + ChecksumIndexInput segmentInfosInput = store.directory() + .openChecksumInput(segmentInfosSnapshotFilenames.get(0), IOContext.READ) + ) { infos = SegmentInfos.readCommit( store.directory(), segmentInfosInput,