You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/11/28 20:07:31 UTC
[GitHub] sijie closed pull request #1843: [ledger storage] DbLedgerStorage
should do periodical flush
sijie closed pull request #1843: [ledger storage] DbLedgerStorage should do periodical flush
URL: https://github.com/apache/bookkeeper/pull/1843
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
index f91bf285b4..ffb92ed2d7 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
@@ -63,6 +63,7 @@
import org.apache.bookkeeper.bookie.LedgerDirsManager.LedgerDirsListener;
import org.apache.bookkeeper.bookie.LedgerDirsManager.NoWritableLedgerDirException;
import org.apache.bookkeeper.bookie.stats.BookieStats;
+import org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage;
import org.apache.bookkeeper.common.util.Watcher;
import org.apache.bookkeeper.conf.ServerConfiguration;
import org.apache.bookkeeper.discover.RegistrationManager;
@@ -681,14 +682,22 @@ public Bookie(ServerConfiguration conf, StatsLogger statsLogger)
LOG.info("Using ledger storage: {}", ledgerStorageClass);
ledgerStorage = LedgerStorageFactory.createLedgerStorage(ledgerStorageClass);
+ boolean isDbLedgerStorage = ledgerStorage instanceof DbLedgerStorage;
+
/*
* with this change https://github.com/apache/bookkeeper/pull/677,
- * LedgerStorage drives the checkpoint logic. But with multiple entry
- * logs, checkpoint logic based on a entry log is not possible, hence it
- * needs to be timebased recurring thing and it is driven by SyncThread.
- * SyncThread.start does that and it is started in Bookie.start method.
+ * LedgerStorage drives the checkpoint logic.
+ *
+ * <p>There are two exceptions:
+ *
+ * 1) with multiple entry logs, checkpoint logic based on a entry log is
+ * not possible, hence it needs to be timebased recurring thing and
+ * it is driven by SyncThread. SyncThread.start does that and it is
+ * started in Bookie.start method.
+ *
+ * 2) DbLedgerStorage
*/
- if (entryLogPerLedgerEnabled) {
+ if (entryLogPerLedgerEnabled || isDbLedgerStorage) {
syncThread = new SyncThread(conf, getLedgerDirsListener(), ledgerStorage, checkpointSource) {
@Override
public void startCheckpoint(Checkpoint checkpoint) {
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services