kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KAFKA-6024) Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()
Date Thu, 01 Feb 2018 01:17:00 GMT

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

Ted Yu edited comment on KAFKA-6024 at 2/1/18 1:16 AM:
-------------------------------------------------------

lgtm


was (Author: yuzhihong@gmail.com):
+1

> 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
(v7.6.3#76005)

Mime
View raw message