artemlivshits commented on code in PR #16075:
URL: https://github.com/apache/kafka/pull/16075#discussion_r1613997769
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateManager.java:
##########
@@ -369,16 +369,21 @@ private boolean isProducerExpired(long currentTimeMs,
ProducerStateEntry produce
* Also expire any verification state entries that are lingering as
unverified.
*/
public void removeExpiredProducers(long currentTimeMs) {
- List<Long> keys = producers.entrySet().stream()
- .filter(entry -> isProducerExpired(currentTimeMs,
entry.getValue()))
- .map(Map.Entry::getKey)
- .collect(Collectors.toList());
+ List<Long> keys = new ArrayList<>();
Review Comment:
If we decided to do perf improvement, should we also avoid the copy? I
think we can just iterate over the producer id entries and remove expired ones
on the spot.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]