You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (Created) (JIRA)" <ji...@apache.org> on 2012/04/03 20:28:23 UTC

[jira] [Created] (KAFKA-324) enforce broker.id to be a non-negative integer

enforce broker.id to be a non-negative integer
----------------------------------------------

                 Key: KAFKA-324
                 URL: https://issues.apache.org/jira/browse/KAFKA-324
             Project: Kafka
          Issue Type: Improvement
    Affects Versions: 0.8
            Reporter: Jun Rao


In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment: kafka-324-v2.patch

Actually all the get* helper functions in Utils throw IllegalArgumentException as they are right now. Added a Utils.require(bool, errmsg) to maintain similar looks of KanfaConfig.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437003#comment-13437003 ] 

Swapnil Ghike commented on KAFKA-324:
-------------------------------------

If there is no such function in scala, we can write our own requireDummy(bool, errmsg, errcode-for-exception). The default way is to go back to if else and throw statements.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment:     (was: kafka-324-v2.patch)
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436973#comment-13436973 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

Thanks for patch v3. Looks good overall. One comment:

1. For all get* in utils that take ByteBuffer, we should throw KafkaException, instead of IllegalArgumentException since they are not argument errors.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao updated KAFKA-324:
--------------------------

       Resolution: Fixed
    Fix Version/s: 0.8
           Status: Resolved  (was: Patch Available)

Thanks for the patch. Committed to 0.8.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>             Fix For: 0.8
>
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch, kafka-324-v4.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Neha Narkhede (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435563#comment-13435563 ] 

Neha Narkhede commented on KAFKA-324:
-------------------------------------

+1. Thanks for the patch!
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Joel Koshy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436156#comment-13436156 ] 

Joel Koshy commented on KAFKA-324:
----------------------------------

I think require is convenient to use - maybe we should have a Utils.require(bool, errormsg) that throws a KafkaException if the condition is unmet.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Labels: newbie noob  (was: bugs replication)
    Status: Patch Available  (was: Open)
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment: kafka-324-v4.patch

Thanks. Attached the changes.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch, kafka-324-v4.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment: kafka-324-v3.patch

Done. 

As a side effect, one test case was modified to catch IllegalArgumentException instead of KafkaException.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436997#comment-13436997 ] 

Swapnil Ghike commented on KAFKA-324:
-------------------------------------

Yes, should have seen that. :\ Is there any concise require-like expression to throw a custom exception? I checked but didn't see any.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment: kafka-324.patch

For negative broker id, it should say the following.

java.lang.IllegalArgumentException: requirement failed: The broker Id must be non-negative.
	at scala.Predef$.require(Predef.scala:145)
	at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:36)
	at kafka.Kafka$.main(Kafka.scala:38)
	at kafka.Kafka.main(Kafka.scala)

                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: bugs, replication
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao closed KAFKA-324.
-------------------------

    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>             Fix For: 0.8
>
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch, kafka-324-v4.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Neha Narkhede (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436096#comment-13436096 ] 

Neha Narkhede commented on KAFKA-324:
-------------------------------------

Jun, I don't think getIntInRange provides any more functionality over require. The only difference is that it throws KafkaException, but if a config value is incorrect, I would imagine it is preferable to get IllegalArgumentException. And require allows you to plug in whatever description you need to make the error message meaningful. It is true that currently our code is using getIntInRange, but I actually like require better. 

Swapnil, as part of maybe another JIRA, do you mind looking into if it is a good idea to move to using require for other config options as well ?
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436379#comment-13436379 ] 

Swapnil Ghike edited comment on KAFKA-324 at 8/17/12 9:47 AM:
--------------------------------------------------------------

Actually all the get* helper functions in Utils throw IllegalArgumentException in 0.7 trunk. Can change the KafkaExceptions to IllegalArgumentException in 0.8. Adding a Utils.require(bool, errmsg) to maintain similar looks of KanfaConfig.
                
      was (Author: swapnilghike):
    Actually all the get* helper functions in Utils throw IllegalArgumentException as they are right now. Added a Utils.require(bool, errmsg) to maintain similar looks of KanfaConfig.
                  
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao reassigned KAFKA-324:
-----------------------------

    Assignee: Swapnil Ghike
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Neha Narkhede (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Neha Narkhede updated KAFKA-324:
--------------------------------

    Labels: replication  (was: )
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: replication
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437033#comment-13437033 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

Yes, we can just do the if/else statements for those. They are not really requirements, but are errors.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch, kafka-324-v3.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436109#comment-13436109 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

That would be fine if we change all KafkaException to require in the get* helper function.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436308#comment-13436308 ] 

Swapnil Ghike commented on KAFKA-324:
-------------------------------------

Using require in Utils looks good to me. Should I make the change in get* functions in Utils?
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436092#comment-13436092 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

Actually, the error message seems fine. It's just that using Utils.getIntInRange is more consistent with the rest of the code in KafkaConfig.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436802#comment-13436802 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

How about we add a new getIntInRange() that doesn't take default (i.e., a required field) and use that for setting broker.id in KafkaConfig? If we think require is more intuitive, we can change all get* helper functions to use require. This way, all properties are set in the same style in KafkaConfig.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Joel Koshy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joel Koshy updated KAFKA-324:
-----------------------------

    Labels: bugs replication  (was: replication)
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: bugs, replication
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Swapnil Ghike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Swapnil Ghike updated KAFKA-324:
--------------------------------

    Attachment: kafka-324-v2.patch
    
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>            Assignee: Swapnil Ghike
>              Labels: newbie, noob
>         Attachments: kafka-324.patch, kafka-324-v2.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-324) enforce broker.id to be a non-negative integer

Posted by "Jun Rao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436089#comment-13436089 ] 

Jun Rao commented on KAFKA-324:
-------------------------------

Instead of using require, it's probably better to use Utils.getIntInRange with a range of 0 and max_int. This way, the error message is more meaningful.
                
> enforce broker.id to be a non-negative integer
> ----------------------------------------------
>
>                 Key: KAFKA-324
>                 URL: https://issues.apache.org/jira/browse/KAFKA-324
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8
>            Reporter: Jun Rao
>              Labels: newbie, noob
>         Attachments: kafka-324.patch
>
>
> In DefaultEventHandler, it seems that we rely on the fact that broker.id is a non-negative integer. However, we don't enforce that in broker startup. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira