apoorvmittal10 commented on code in PR #23911:
URL: https://github.com/apache/kafka/pull/23911#discussion_r4354453382


##########
core/src/test/java/kafka/server/share/SharePartitionManagerTest.java:
##########
@@ -3268,14 +3265,30 @@ static Seq<Tuple2<TopicIdPartition, LogReadResult>> 
buildLogReadResult(List<Topi
             Compression.NONE, new SimpleRecord("test-key".getBytes(), 
"test-value".getBytes())));
     }
 
+    static Seq<Tuple2<TopicIdPartition, LogReadResult>> buildLogReadResult(
+        List<TopicIdPartition> topicIdPartitions,
+        Map<TopicIdPartition, LogOffsetMetadata> fetchOffsetMetadata
+    ) {
+        return buildLogReadResult(topicIdPartitions, MemoryRecords.withRecords(
+            Compression.NONE, new SimpleRecord("test-key".getBytes(), 
"test-value".getBytes())), fetchOffsetMetadata);
+    }
+
     static Seq<Tuple2<TopicIdPartition, LogReadResult>> 
buildEmptyLogReadResult(List<TopicIdPartition> topicIdPartitions) {
         return buildLogReadResult(topicIdPartitions, MemoryRecords.EMPTY);
     }
 
     static Seq<Tuple2<TopicIdPartition, LogReadResult>> 
buildLogReadResult(List<TopicIdPartition> topicIdPartitions, Records records) {
+        return buildLogReadResult(topicIdPartitions, records, Map.of());
+    }
+
+    static Seq<Tuple2<TopicIdPartition, LogReadResult>> buildLogReadResult(
+        List<TopicIdPartition> topicIdPartitions,
+        Records records,
+        Map<TopicIdPartition, LogOffsetMetadata> fetchOffsetMetadata
+    ) {
         List<Tuple2<TopicIdPartition, LogReadResult>> logReadResults = new 
ArrayList<>();
         topicIdPartitions.forEach(topicIdPartition -> logReadResults.add(new 
Tuple2<>(topicIdPartition, new LogReadResult(
-            new FetchDataInfo(new LogOffsetMetadata(0, 0, 0), records),
+            new 
FetchDataInfo(fetchOffsetMetadata.getOrDefault(topicIdPartition, new 
LogOffsetMetadata(0, 0, 0)), records),

Review Comment:
   Done.



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

Reply via email to