kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-6024) Consider moving validation in KafkaConsumer ahead of call to acquireAndEnsureOpen()
Date Sat, 21 Oct 2017 07:08:00 GMT

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

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

GitHub user shivsantham opened a pull request:

    https://github.com/apache/kafka/pull/4109

    KAFKA-6024 - Move validation in KafkaConsumer ahead of acquireAndEnsu…

    In several methods, parameter validation is done after calling acquireAndEnsureOpen()
in Kafka Consumer :
    
        public void seek(TopicPartition partition, long offset) {
            acquireAndEnsureOpen();
            try {
                if (offset < 0)
                    throw new IllegalArgumentException("seek offset must not be a negative
number");
    
    Since the value of parameter would not change per invocation, it seems performing validation
ahead of acquireAndEnsureOpen() call would be better.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shivsantham/kafka kafka-6024

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/4109.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4109
    
----
commit 79b6fbcff617f6412798d6395b3378df5dd601ed
Author: siva santhalingam <siva.santhalingam@gmail.com>
Date:   2017-10-21T07:05:03Z

    KAFKA-6024 - Move validation in KafkaConsumer ahead of acquireAndEnsureOpen()

----


> 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)

Mime
View raw message