diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java index 597a2415a1ef..4f528a83c201 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java @@ -130,6 +130,18 @@ private boolean hasPermission(UserGroupInformation user) { } } + private static void logSstFileList(ListsstList, String msg, int sampleSize) { + int count = sstList.size(); + if (LOG.isDebugEnabled()) { + LOG.debug(msg, count, "", sstList); + } else if (count > sampleSize) { + List sample = sstList.subList(0, sampleSize); + LOG.info(msg, count, ", sample", sample); + } else { + LOG.info(msg, count, "", sstList); + } + } + /** * Generates Snapshot checkpoint as tar ball. * @param request the HTTP servlet request @@ -195,7 +207,8 @@ private void generateSnapshotCheckpoint(HttpServletRequest request, .filter(s -> s.endsWith(ROCKSDB_SST_SUFFIX)) .distinct() .collect(Collectors.toList())); - LOG.info("Received excluding SST {}", receivedSstList); + logSstFileList(receivedSstList, + "Received list of {} SST files to be excluded{}: {}", 5); } Path tmpdir = null; @@ -229,9 +242,8 @@ private void generateSnapshotCheckpoint(HttpServletRequest request, long duration = Duration.between(start, end).toMillis(); LOG.info("Time taken to write the checkpoint to response output " + "stream: {} milliseconds", duration); - - LOG.info("Excluded SST {} from the latest checkpoint.", - excludedSstList); + logSstFileList(excludedSstList, + "Excluded {} SST files from the latest checkpoint{}: {}", 5); if (!excludedSstList.isEmpty()) { dbMetrics.incNumIncrementalCheckpoint(); }