Carl-Zhou-CN commented on code in PR #3157:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3157#discussion_r1005540004


##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceSplitEnumerator.java:
##########
@@ -91,20 +122,20 @@ public void close() throws IOException {
     @Override
     public void addSplitsBack(List<KafkaSourceSplit> splits, int subtaskId) {
         if (!splits.isEmpty()) {
-            pendingSplit.addAll(convertToNextSplit(splits));
+            pendingSplit.putAll(convertToNextSplit(splits));
             assignSplit();
         }
     }
 
-    private Collection<? extends KafkaSourceSplit> 
convertToNextSplit(List<KafkaSourceSplit> splits) {
+    private Map<TopicPartition, ? extends KafkaSourceSplit> 
convertToNextSplit(List<KafkaSourceSplit> splits) {
         try {
-            Map<TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> 
listOffsets =
-                
getKafkaPartitionLatestOffset(splits.stream().map(KafkaSourceSplit::getTopicPartition).collect(Collectors.toList()));
+            Map<TopicPartition, Long> listOffsets =
+                
listOffsets(splits.stream().map(KafkaSourceSplit::getTopicPartition).collect(Collectors.toList()),
 OffsetSpec.earliest());

Review Comment:
   Ok, I will add e2e tests later



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