You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "m1a2st (via GitHub)" <gi...@apache.org> on 2025/08/26 10:20:28 UTC
[PR] MINOR: Optimize the entriesWithoutErrorsPerPartition when errorResults is empty [kafka]
m1a2st opened a new pull request, #20410:
URL: https://github.com/apache/kafka/pull/20410
If `errorResults` is empty, there’s no need to create a new `entriesPerPartition` map.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize the entriesWithoutErrorsPerPartition when errorResults is empty [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20410:
URL: https://github.com/apache/kafka/pull/20410#discussion_r2300546215
##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -788,7 +788,9 @@ class ReplicaManager(val config: KafkaConfig,
hasCustomErrorMessage = customException.isDefined
)
}
- val entriesWithoutErrorsPerPartition = entriesPerPartition.filter { case (key, _) => !errorResults.contains(key) }
+ val entriesWithoutErrorsPerPartition =
+ if (errorResults.nonEmpty) entriesPerPartition.filter { case (key, _) => !errorResults.contains(key) }
+ else entriesPerPartition
Review Comment:
Could you please add comments explaining the minor optimization?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Optimize the entriesWithoutErrorsPerPartition when errorResults is empty [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #20410:
URL: https://github.com/apache/kafka/pull/20410
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org