From f4db20b935456b0370c535041290be14e3124938 Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Fri, 22 Jul 2022 16:17:48 +0530 Subject: [PATCH] Addressing review comment Signed-off-by: Bharathwaj G --- .../action/search/CreatePitController.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/search/CreatePitController.java b/server/src/main/java/org/opensearch/action/search/CreatePitController.java index d59268b087e80..f64dd3d7efae6 100644 --- a/server/src/main/java/org/opensearch/action/search/CreatePitController.java +++ b/server/src/main/java/org/opensearch/action/search/CreatePitController.java @@ -274,13 +274,14 @@ public void onResponse(DeletePitResponse response) { .filter(r -> !r.isSuccessful()) .forEach(r -> failedPitsStringBuilder.append(r.getPitId()).append(",")); logger.warn(() -> new ParameterizedMessage("Failed to delete PIT IDs {}", failedPitsStringBuilder.toString())); - if (!logger.isDebugEnabled()) return; - final StringBuilder successfulPitsStringBuilder = new StringBuilder(); - response.getDeletePitResults() - .stream() - .filter(r -> r.isSuccessful()) - .forEach(r -> successfulPitsStringBuilder.append(r.getPitId()).append(",")); - logger.debug(() -> new ParameterizedMessage("Deleted PIT with IDs {}", successfulPitsStringBuilder.toString())); + if (logger.isDebugEnabled()) { + final StringBuilder successfulPitsStringBuilder = new StringBuilder(); + response.getDeletePitResults() + .stream() + .filter(r -> r.isSuccessful()) + .forEach(r -> successfulPitsStringBuilder.append(r.getPitId()).append(",")); + logger.debug(() -> new ParameterizedMessage("Deleted PIT with IDs {}", successfulPitsStringBuilder.toString())); + } } @Override