kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject kafka git commit: TRIVIAL: change to API doc for seekToEnd() to clarify lazy evaluation
Date Tue, 08 Sep 2015 22:17:37 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 926297566 -> f8902981c


TRIVIAL: change to API doc for seekToEnd() to clarify lazy evaluation

Small clarification to docs. Current behaviour could confuse when doing something like:
consumer.seekToEnd()
consumer.send(msg)
consumer.poll() //would return msg as seek evaluates lazily

Author: Ben Stopford <benstopford@gmail.com>

Reviewers: Gwen Shapira

Closes #199 from benstopford/minor-stuff


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/f8902981
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/f8902981
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/f8902981

Branch: refs/heads/trunk
Commit: f8902981c65ac93426c0edc65d10381d7c285ea1
Parents: 9262975
Author: Ben Stopford <benstopford@gmail.com>
Authored: Tue Sep 8 15:17:15 2015 -0700
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Tue Sep 8 15:17:15 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/kafka/clients/consumer/KafkaConsumer.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/f8902981/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
----------------------------------------------------------------------
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 73237e4..382c388 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
@@ -909,7 +909,8 @@ public class KafkaConsumer<K, V> implements Consumer<K, V>
{
     }
 
     /**
-     * Seek to the last offset for each of the given partitions
+     * Seek to the last offset for each of the given partitions. This function evaluates
lazily, seeking to the
+     * final offset in all partitions only when poll() or position() are called.
      */
     public void seekToEnd(TopicPartition... partitions) {
         acquire();


Mime
View raw message