reddycharan commented on a change in pull request #1281: Issue #570:
Introducing EntryLogManager.
URL: https://github.com/apache/bookkeeper/pull/1281#discussion_r176651575
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
##########
@@ -292,12 +308,28 @@ public EntryLogger(ServerConfiguration conf,
logId = lastLogId;
}
}
- this.leastUnflushedLogId = logId + 1;
+ this.recentlyCreatedEntryLogsStatus = new RecentEntryLogsStatus(logId
+ 1);
this.entryLoggerAllocator = new EntryLoggerAllocator(logId);
- this.conf = conf;
- this.entryLogPerLedgerEnabled = conf.isEntryLogPerLedgerEnabled();
-
- initialize();
+ if (entryLogPerLedgerEnabled) {
+ this.entryLogManager = new EntryLogManagerForSingleEntryLog() {
+ @Override
+ public void checkpoint() throws IOException {
+ /*
+ * In the case of entryLogPerLedgerEnabled we need to flush
+ * both rotatedlogs and currentlogs. This is needed because
+ * syncThread periodically does checkpoint and at this time
+ * all the logs should be flushed.
+ *
+ */
+ if (entryLogPerLedgerEnabled) {
Review comment:
nit: it should be simply, (will fix it in next iteration)
public void checkpoint() throws IOException {
flushCurrentLogs();
super.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:
[email protected]
With regards,
Apache Git Services