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_r239952685
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
##########
@@ -601,6 +602,64 @@ public Bookie(ServerConfiguration conf)
this(conf, NullStatsLogger.INSTANCE);
}
+ private static LedgerStorage buildLedgerStorage(ServerConfiguration conf)
throws IOException {
+ // Instantiate the ledger storage implementation
+ String ledgerStorageClass = conf.getLedgerStorageClass();
+ LOG.info("Using ledger storage: {}", ledgerStorageClass);
+ return LedgerStorageFactory.createLedgerStorage(ledgerStorageClass);
+ }
+
+ /**
+ * Initialize LedgerStorage instance without checkpointing for use within
the shell
+ * and other RO users. ledgerStorage must not have already been
initialized.
+ *
+ * @param conf Bookie config.
+ * @param ledgerStorage Instance to initialize.
+ * @return Passed ledgerStorage instance
+ * @throws IOException
+ */
+ static LedgerStorage mountLedgerStorageOffline(
+ ServerConfiguration conf,
+ LedgerStorage ledgerStorage) throws IOException {
+ StatsLogger statsLogger = NullStatsLogger.INSTANCE;
+ DiskChecker diskChecker = new
DiskChecker(conf.getDiskUsageThreshold(), conf.getDiskUsageWarnThreshold());
Review comment:
Probably, but I'd like to leave that refactor for another time.
----------------------------------------------------------------
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