arpit09 commented on code in PR #4009:
URL: https://github.com/apache/gobblin/pull/4009#discussion_r1705320733


##########
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/GobblinKafkaConsumerClient.java:
##########
@@ -66,6 +66,25 @@ public interface GobblinKafkaConsumerClient extends 
Closeable {
    */
   public long getEarliestOffset(KafkaPartition partition) throws 
KafkaOffsetRetrievalFailureException;
 
+  /**
+   * Get the earliest available offset for a {@link Collection} of {@link 
KafkaPartition}s. NOTE: The default implementation
+   * is not efficient i.e. it will make a getEarliest() call for every {@link 
KafkaPartition}. Individual implementations
+   * of {@link GobblinKafkaConsumerClient} should override this method to use 
more advanced APIs of the underlying KafkaConsumer
+   * to retrieve the latest offsets for a collection of partitions.
+   *
+   * @param partitions for which earliest offset is retrieved
+   *
+   * @throws KafkaOffsetRetrievalFailureException - If the underlying 
kafka-client does not support getting the earliest offset
+   */
+  public default Map<KafkaPartition, Long> 
getEarliestOffsets(Collection<KafkaPartition> partitions)

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