You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jay Kreps (JIRA)" <ji...@apache.org> on 2015/12/16 00:51:46 UTC

[jira] [Commented] (KAFKA-2991) Improve collection type consistency in KafkaConsumer API

    [ https://issues.apache.org/jira/browse/KAFKA-2991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15059130#comment-15059130 ] 

Jay Kreps commented on KAFKA-2991:
----------------------------------

Sucks we didn't catch this in our reviews, changing it now will break compatibility. :-(

> Improve collection type consistency in KafkaConsumer API
> --------------------------------------------------------
>
>                 Key: KAFKA-2991
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2991
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Jason Gustafson
>            Assignee: Jason Gustafson
>
> The KafkaConsumer API has some annoying inconsistencies in the usage of collection types. For example, subscribe() takes a list, but subscription() returns a set. Similarly for assign() and assignment(). We also have pause() and resume() which annoyingly use a variable argument array, which means you have to copy the result of assignment() to an array if you want to pause all assigned partitions. We can solve these issues by adding the following variants:
> {code}
> void subscribe(Collection<String> topics);
> void assign(Collection<TopicPartition> partitions);
> void pause(Collection<TopicPartition> partitions);
> void resume(Collection<TopicPartition> partitions);
> {code}
> I'm not actually sure that there is any need for the generic Collection, so an alternative would be to just use Set.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)