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/05/01 06:50:14 UTC

[GitHub] sijie commented on a change in pull request #1375: BP14 - forceLedger bookie side implementation

sijie commented on a change in pull request #1375: BP14 - forceLedger bookie side implementation
URL: https://github.com/apache/bookkeeper/pull/1375#discussion_r185174435
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
 ##########
 @@ -1141,6 +1145,40 @@ private void addEntryInternal(LedgerDescriptor handle, ByteBuf entry,
         getJournal(ledgerId).logAddEntry(entry, ackBeforeSync, cb, ctx);
     }
 
+    /**
+     * Force write on the journal assigned to the given ledger.
+     * It works like a regular addEntry with ackBeforeSync=false but without really
+     * writing to disk.
+     */
+    private void forceLedgerInternal(LedgerDescriptor handle,
+                                     WriteCallback cb, Object ctx, byte[] masterKey)
+            throws IOException, BookieException {
+        long ledgerId = handle.getLedgerId();
+
+
+        if (masterKeyCache.get(ledgerId) == null) {
 
 Review comment:
   you don't need to change addEntry, but you can abstract line 1156 to line 1173 as a common method? so this common method can be called in addEntry and forceLedgerInternal, rather than duplicating code.

----------------------------------------------------------------
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