dajac commented on a change in pull request #9630:
URL: https://github.com/apache/kafka/pull/9630#discussion_r531123780



##########
File path: 
core/src/test/scala/unit/kafka/server/epoch/util/ReplicaFetcherMockBlockingSend.scala
##########
@@ -78,7 +80,19 @@ class ReplicaFetcherMockBlockingSend(offsets: 
java.util.Map[TopicPartition, Epoc
         callback.foreach(_.apply())
         epochFetchCount += 1
         lastUsedOffsetForLeaderEpochVersion = 
requestBuilder.latestAllowedVersion()
-        new OffsetsForLeaderEpochResponse(currentOffsets)
+
+        val data = new OffsetForLeaderEpochResponseData()
+        currentOffsets.forEach((tp, offsetForLeaderPartition) => {
+          var topic = data.topics.find(tp.topic)
+          if (topic == null) {
+            topic = new OffsetForLeaderTopicResult()
+              .setTopic(tp.topic)
+            data.topics.add(topic)
+          }
+          
topic.partitions.add(offsetForLeaderPartition.setPartition(tp.partition))

Review comment:
       Hum.. I am not sure to understand the `duplicate` suggestion here. Could 
you elaborate?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to