vrajat commented on code in PR #12608:
URL: https://github.com/apache/pinot/pull/12608#discussion_r1518174041


##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-2.0/src/main/java/org/apache/pinot/plugin/stream/kafka20/KafkaPartitionLevelConsumer.java:
##########
@@ -69,8 +69,12 @@ public synchronized MessageBatch<StreamMessage<byte[]>> 
fetchMessages(long start
     ConsumerRecords<String, Bytes> consumerRecords = 
_consumer.poll(Duration.ofMillis(timeoutMillis));
     List<ConsumerRecord<String, Bytes>> messageAndOffsets = 
consumerRecords.records(_topicPartition);
     List<StreamMessage<byte[]>> filtered = new 
ArrayList<>(messageAndOffsets.size());
+    long firstOffset = startOffset;
     long lastOffset = startOffset;
     StreamMessageMetadata rowMetadata = null;
+    if (!consumerRecords.isEmpty()) {
+      firstOffset = consumerRecords.iterator().next().offset();
+    }

Review Comment:
   Yes. that condition is checking if the offset of a message is between start, 
end offset while it is looping through the messages in the batch. 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to