You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "siva santhalingam (JIRA)" <ji...@apache.org> on 2017/11/15 22:53:00 UTC

[jira] [Commented] (KAFKA-6024) Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()

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

siva santhalingam commented on KAFKA-6024:
------------------------------------------

[~tedyu] Could you please merge this to the next release branch. Thanks!

> Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()
> -----------------------------------------------------------------------------------
>
>                 Key: KAFKA-6024
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6024
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Ted Yu
>            Assignee: siva santhalingam
>            Priority: Minor
>
> In several methods, parameter validation is done after calling acquireAndEnsureOpen() :
> {code}
>     public void seek(TopicPartition partition, long offset) {
>         acquireAndEnsureOpen();
>         try {
>             if (offset < 0)
>                 throw new IllegalArgumentException("seek offset must not be a negative number");
> {code}
> Since the value of parameter would not change per invocation, it seems performing validation ahead of acquireAndEnsureOpen() call would be better.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)