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 2022/10/08 03:37:05 UTC

[GitHub] [pulsar] lordcheng10 commented on a diff in pull request #17753: [improve][broker]Skip numOfEntriesToRead entries instead of skipping a ledger

lordcheng10 commented on code in PR #17753:
URL: https://github.com/apache/pulsar/pull/17753#discussion_r987701202


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -3473,7 +3473,17 @@ public PositionImpl getNextValidPosition(final PositionImpl position) {
         }
         return next;
     }
-
+    public PositionImpl getValidPositionAfterSkippedEntries(final PositionImpl position, int skippedEntryNum) {
+        PositionImpl skippedPosition = position.getPositionAfterEntries(skippedEntryNum);
+        while (!isValidPosition(skippedPosition)) {

Review Comment:
   @Jason918 PTAL,thanks!
   
   The two methods are different.
   The getValidPositionAfterSkippedEntries method skips multiple messages at a time, while the getNextValidPosition method skips only one message at a time:
   
   <img width="1040" alt="image" src="https://user-images.githubusercontent.com/19296967/194024559-2b5f6418-f56f-476e-9636-040d4ab7007c.png">
   



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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org