You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/04/18 17:58: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=17086563#comment-17086563 ] 

ASF GitHub Bot commented on KAFKA-6024:
---------------------------------------

harshitshah4 commented on pull request #8512: KAFKA-6024: Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()
URL: https://github.com/apache/kafka/pull/8512
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> 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
>             Fix For: 2.0.0
>
>
> 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
(v8.3.4#803005)