kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: MINOR: Clarify meaning of end offset in consumer javadocs (#4885)
Date Fri, 20 Apr 2018 20:00:22 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git

The following commit(s) were added to refs/heads/trunk by this push:
     new d9e804b  MINOR: Clarify meaning of end offset in consumer javadocs (#4885)
d9e804b is described below

commit d9e804b88952160630eb305ff05978b66cbbf49f
Author: Arjun Satish <wicknicks@users.noreply.github.com>
AuthorDate: Fri Apr 20 13:00:11 2018 -0700

    MINOR: Clarify meaning of end offset in consumer javadocs (#4885)
    Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
 .../org/apache/kafka/clients/consumer/KafkaConsumer.java     | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
index 81137f3..0b18927 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
@@ -1646,16 +1646,14 @@ public class KafkaConsumer<K, V> implements Consumer<K, V>
-     * Get the last offset for the given partitions.  The last offset of a partition is the
offset of the upcoming
-     * message, i.e. the offset of the last available message + 1.  If messages have never
been written
-     * to the the partition, the offset returned will be 0.
+     * Get the end offsets for the given partitions. In the default {@code read_uncommitted}
isolation level, the end
+     * offset is the high watermark (that is, the offset of the last successfully replicated
message plus one). For
+     * {@code read_committed} consumers, the end offset is the last stable offset (LSO),
which is the minimum of
+     * the high watermark and the smallest offset of any open transaction. Finally, if the
partition has never been
+     * written to, the end offset is 0.
      * <p>
      * This method does not change the current consumer position of the partitions.
-     * <p>
-     * When {@code isolation.level=read_committed} the last offset will be the Last Stable
Offset (LSO).
-     * This is the offset of the first message with an open transaction. The LSO moves forward
as transactions
-     * are completed.
      * @see #seekToEnd(Collection)

To stop receiving notification emails like this one, please contact

View raw message