From 8820eac8f3befc90aa0f33be16a4b7660dffe8a1 Mon Sep 17 00:00:00 2001 From: rdhabalia Date: Tue, 5 Feb 2019 19:58:02 -0800 Subject: [PATCH] add debug logs --- .../bookkeeper/bookie/ScanAndCompareGarbageCollector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java index 8d6b8e82959..389c2dcada1 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java @@ -135,6 +135,8 @@ public void gc(GarbageCleaner garbageCleaner) { return; } + long startTime = System.currentTimeMillis(); + LOG.info("starting gc - zk traversing"); try { // Get a set of all ledgers on the bookie NavigableSet bkActiveLedgers = Sets.newTreeSet(ledgerStorage.getActiveLedgersInRange(0, @@ -217,6 +219,8 @@ public void gc(GarbageCleaner garbageCleaner) { // ignore exception, collecting garbage next time LOG.warn("Exception when iterating over the metadata {}", t); } finally { + long endTime = System.currentTimeMillis(); + LOG.info("Total GC time {}", TimeUnit.MILLISECONDS.toSeconds(endTime - startTime)); if (zk != null) { try { zk.close();