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

Jason Gustafson commented on KAFKA-3006:
----------------------------------------

Argh. I'm kicking myself for not fixing this prior to the release. Supporting 
both varargs and collections is not really about value, but compatibility. If 
we're fine breaking compatibility, then let's drop the vararg variant and use 
Collection everywhere. I'd personally say that the very small increase in 
surface area is worth the trade to keep compatibility, but perhaps it's early 
enough that we can get away with it. The alternative, doing nothing, means 
accepting the current inconsistent usage and seeing this issue pop up again and 
again on the user list. As for changing List to Collection, I agree that the 
risk is lower if we make the change.

> Make collection default container type for sequences in the consumer API
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-3006
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3006
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>    Affects Versions: 0.9.0.0
>            Reporter: Pierre-Yves Ritschard
>              Labels: patch
>
> 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() 
> , seekToBeginning(), seekToEnd(), 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 subscribe(Collection<String> topics, ConsumerRebalanceListener);
> void assign(Collection<TopicPartition> partitions);
> void pause(Collection<TopicPartition> partitions);
> void resume(Collection<TopicPartition> partitions);
> void seekToBeginning(Collection<TopicPartition>);
> void seekToEnd(Collection<TopicPartition>);
> {code}
> This issues supersedes KAFKA-2991



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

Reply via email to