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:
[email protected]


Reply via email to