kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject kafka git commit: KAFKA-2892 Consumer Docs Use Wrong Method
Date Thu, 26 Nov 2015 06:31:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.9.0 33b4d3c4c -> 4f3bdca5b


KAFKA-2892 Consumer Docs Use Wrong Method

The KafkaConsumer docs use a non-existent method for assigning partitions (consumer.assign).

The JavaDocs show as:
```
String topic = "foo";
TopicPartition partition0 = new TopicPartition(topic, 0);
TopicPartition partition1 = new TopicPartition(topic, 1);
consumer.assign(partition0);
consumer.assign(partition1);
```

Should be:
```
String topic = "foo";
TopicPartition partition0 = new TopicPartition(topic, 0);
TopicPartition partition1 = new TopicPartition(topic, 1);
consumer.assign(Arrays.asList(partition0, partition1));
```

Author: Jesse Anderson <eljefe6a@gmail.com>

Reviewers: Ewen Cheslack-Postava, Gwen Shapira

Closes #592 from eljefe6a/trunk

(cherry picked from commit c18a1bd64e7f8416e8256b968fe1b9e2da553b00)
Signed-off-by: Gwen Shapira <cshapi@gmail.com>


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

Branch: refs/heads/0.9.0
Commit: 4f3bdca5bfd0b795a850ab45ef049dc94ddd8bd8
Parents: 33b4d3c
Author: Jesse Anderson <eljefe6a@gmail.com>
Authored: Wed Nov 25 22:30:18 2015 -0800
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Wed Nov 25 22:30:46 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/kafka/blob/4f3bdca5/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 660c530..6237e08 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
@@ -243,8 +243,7 @@ import java.util.regex.Pattern;
  *     String topic = &quot;foo&quot;;
  *     TopicPartition partition0 = new TopicPartition(topic, 0);
  *     TopicPartition partition1 = new TopicPartition(topic, 1);
- *     consumer.assign(partition0);
- *     consumer.assign(partition1);
+ *     consumer.assign(Arrays.asList(partition0, partition1));
  * </pre>
  *
  * The group that the consumer specifies is still used for committing offsets, but now the
set of partitions will only


Mime
View raw message