You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/24 05:19:45 UTC

[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #10330: Fix message buffer being copied from direct memory to heap memory

michaeljmarshall commented on a change in pull request #10330:
URL: https://github.com/apache/pulsar/pull/10330#discussion_r619588992



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -766,26 +766,24 @@ private synchronized void internalAsyncAddEntry(OpAddEntry addOperation) {
                 STATE_UPDATER.set(this, State.ClosingLedger);
             }
             // interceptor entry before add to bookie
-            if (beforeAddEntry(addOperation)) {
-                addOperation.initiate();
-            }
+            beforeAddEntry(addOperation).ifPresent(OpAddEntry::initiate);
         }
     }
 
-    private boolean beforeAddEntry(OpAddEntry addOperation) {
+    private Optional<OpAddEntry> beforeAddEntry(OpAddEntry addOperation) {
         // if no interceptor, just return true to make sure addOperation will be initiate()

Review comment:
       This comment should be updated to reflect the new return type.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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