showuon commented on code in PR #12753:
URL: https://github.com/apache/kafka/pull/12753#discussion_r1046867071


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1581,7 +1581,27 @@ public void commitAsync(final Map<TopicPartition, 
OffsetAndMetadata> offsets, Of
      * Overrides the fetch offsets that the consumer will use on the next 
{@link #poll(Duration) poll(timeout)}. If this API
      * is invoked for the same partition more than once, the latest offset 
will be used on the next poll(). Note that
      * you may lose data if this API is arbitrarily used in the middle of 
consumption, to reset the fetch offsets
+     * <p>
+     * The next Consumer Record which will be retrieved when poll() is invoked 
will have the offset specified, given that
+     * a record with that offset exists (ie: it is a valid offset).
+     * <p>
+     * {@link KafkaConsumer#seekToBeginning(Collection)} will go to the first 
offset in the topic.
+     * seek(0) is equivalent to seekToBeginning for a topic with beginning 
offset 0,
+     * assuming that there is a record at offset 0 still available.
+     * {@link KafkaConsumer#seekToEnd(Collection)} is equivalent to seeking to 
the highest known offset + 1.

Review Comment:
   One thing to note here, the seekToEnd might seek to `log end offset` or 
`Last Stable Offset` depends on `read-committed` or `read-uncommitted`. So we 
need to be cautious for the wording here.   



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to