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_r235225047
##########
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:
There weren't any other users and I found this to be clearer. I don't feel
strongly about it and could be convinced otherwise.
----------------------------------------------------------------
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