From 8ffb8e60dd050a15b94b4c873c0cb3f97cb7068d Mon Sep 17 00:00:00 2001 From: Sachin Kale Date: Fri, 12 Apr 2024 15:17:37 +0530 Subject: [PATCH] Fix Spotless errors Signed-off-by: Sachin Kale --- .../src/main/java/org/opensearch/index/shard/IndexShard.java | 5 ++++- .../indices/replication/SegmentReplicationTarget.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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,