athanatos commented on a change in pull request #1819: ISSUE-1770: Add local 
checker for Sorted/InterleavedLedgerStorage
URL: https://github.com/apache/bookkeeper/pull/1819#discussion_r237963358
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
 ##########
 @@ -740,19 +748,69 @@ public int runCmd(CommandLine cmdLine) throws Exception {
                 // dump ledger info
                 try {
                     DbLedgerStorage.readLedgerIndexEntries(ledgerId, bkConf,
-                            (currentEntry, entryLogId, position) -> 
System.out.println(
+                            (currentEntry, entryLogId, position) -> 
printInfoLine(
                                     "entry " + currentEntry + "\t:\t(log: " + 
entryLogId + ", pos: " + position + ")"));
                 } catch (IOException e) {
                     System.err.printf("ERROR: initializing dbLedgerStorage 
%s", e.getMessage());
                     return -1;
                 }
-            } else {
+            } else if 
((bkConf.getLedgerStorageClass().equals(SortedLedgerStorage.class.getName())
+                    || 
bkConf.getLedgerStorageClass().equals(InterleavedLedgerStorage.class.getName())))
 {
+                ServerConfiguration conf = new ServerConfiguration(bkConf);
+                InterleavedLedgerStorage interleavedStorage = new 
InterleavedLedgerStorage();
+                Bookie.mountLedgerStorageOffline(conf, interleavedStorage);
+
                 if (printMeta) {
                     // print meta
-                    readLedgerMeta(ledgerId);
+                    printInfoLine("===== LEDGER: " + 
ledgerIdFormatter.formatLedgerId(ledgerId) + " =====");
 
 Review comment:
   Oh, it was touched.  That's the reason for the new unit tests.  I reworked 
them to use the new entry iteration machinery.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to