FrankYang0529 commented on code in PR #19793:
URL: https://github.com/apache/kafka/pull/19793#discussion_r2798953956
##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -983,23 +1003,25 @@ class ReplicaManager(val config: KafkaConfig,
delayedProducePurgatory.tryCompleteElseWatch(delayedProduce,
producerRequestKeys.asJava)
} else {
// we can respond immediately
- val produceResponseStatus = initialProduceStatus.map { case (k, status)
=> k -> status.responseStatus }
+ val produceResponseStatus = new util.HashMap[TopicIdPartition,
PartitionResponse]
+ initialProduceStatus.foreach { case (k, status) => k ->
produceResponseStatus.put(k, status.responseStatus) }
Review Comment:
It looks like we can simplify this as following:
```suggestion
initialProduceStatus.foreach { case (k, status) =>
produceResponseStatus.put(k, status.responseStatus) }
```
--
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]