merlimat commented on a change in pull request #3732: [pulsar-broker] Optimize 
message replay for large backlog consumer
URL: https://github.com/apache/pulsar/pull/3732#discussion_r261814944
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
 ##########
 @@ -288,8 +287,8 @@ public void readMoreEntries() {
                     return;
                 }
 
-                Set<PositionImpl> messagesToReplayNow = 
messagesToReplay.items(messagesToRead).stream()
-                        .map(pair -> new PositionImpl(pair.first, 
pair.second)).collect(toSet());
+                Set<PositionImpl> messagesToReplayNow = 
messagesToReplay.items(messagesToRead,
 
 Review comment:
   Instead of having the `messagesToReplay ` to be sorted, wouldn't be easier 
to just make the `messagesToReplayNow` to be a `SortedSet` ? 
   
   In this case, we don't care to have `messagesToReplay` to be *always* 
sorted, just when there is a redelivery is when we care. 

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


With regards,
Apache Git Services

Reply via email to