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:30:29 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk abf6b2ebb -> c18a1bd64


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


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

Branch: refs/heads/trunk
Commit: c18a1bd64e7f8416e8256b968fe1b9e2da553b00
Parents: abf6b2e
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:18 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/c18a1bd6/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 3d180fb..233d7a2 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