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

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

GitHub user auroraxlh opened a pull request:

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

    KAFKA-4603 Command parsed error, change all OptionParser constructor 

    KAFKA-4603 the command parsed error
    Using "new OptionParser" might result in parse error
    
    Change all the OptionParser constructor in Kafka into "new 
OptionParser(false)"

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

    $ git pull https://github.com/auroraxlh/kafka fix_OptionParser_bug

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

    https://github.com/apache/kafka/pull/2349.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 #2349
    
----
commit 749fa3786f1b283409462698856369f20793ef57
Author: auroraxlh <xin.lih...@zte.com.cn>
Date:   2017-01-12T09:35:23Z

    KAFKA-4603 the command parsed error
    
    Using "new OptionParser" might result in parse error
    
Change all the OptionParser constructor in Kafka into "new OptionParser(false)"

----


> the argument of shell in doc wrong and command parsed error
> -----------------------------------------------------------
>
>                 Key: KAFKA-4603
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4603
>             Project: Kafka
>          Issue Type: Bug
>          Components: admin, documentation
>    Affects Versions: 0.10.0.1, 0.10.2.0
>         Environment: suse
>            Reporter: Xin
>            Assignee: Xin
>            Priority: Minor
>
> according to the 7.6.2 Migrating clusters of document :
> ./zookeeper-security-migration.sh --zookeeper.acl=secure 
> --zookeeper.connection=localhost:2181
> joptsimple.OptionArgumentConversionException: Cannot parse argument 
> 'localhost:2181' of option zookeeper.connection.timeout
>       at joptsimple.AbstractOptionSpec.convertWith(AbstractOptionSpec.java:93)
>       at 
> joptsimple.ArgumentAcceptingOptionSpec.convert(ArgumentAcceptingOptionSpec.java:274)
>       at joptsimple.OptionSet.valuesOf(OptionSet.java:223)
>       at joptsimple.OptionSet.valueOf(OptionSet.java:172)
>       at kafka.admin.ZkSecurityMigrator$.run(ZkSecurityMigrator.scala:111)
>       at kafka.admin.ZkSecurityMigrator$.main(ZkSecurityMigrator.scala:119)
>       at kafka.admin.ZkSecurityMigrator.main(ZkSecurityMigrator.scala)
> Caused by: joptsimple.internal.ReflectionException: 
> java.lang.NumberFormatException: For input string: "localhost:2181"
>       at 
> joptsimple.internal.Reflection.reflectionException(Reflection.java:140)
>       at joptsimple.internal.Reflection.invoke(Reflection.java:122)
>       at 
> joptsimple.internal.MethodInvokingValueConverter.convert(MethodInvokingValueConverter.java:48)
>       at joptsimple.internal.Reflection.convertWith(Reflection.java:128)
>       at joptsimple.AbstractOptionSpec.convertWith(AbstractOptionSpec.java:90)
>       ... 6 more
> Caused by: java.lang.NumberFormatException: For input string: "localhost:2181"
>       at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>       at java.lang.Integer.parseInt(Integer.java:492)
>       at java.lang.Integer.valueOf(Integer.java:582)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:606)
>       at joptsimple.internal.Reflection.invoke(Reflection.java:119)
>       ... 9 more
> ===>the argument  "zookeeper.connection" has been parsed to 
> "zookeeper.connection.timeout"
> using help i found that  the argument  is :
> --zookeeper.connect                    Sets the ZooKeeper connect string     
>                                          (ensemble). This parameter takes a  
>                                          comma-separated list of host:port   
>                                          pairs. (default: localhost:2181)    
> --zookeeper.connection.timeout         Sets the ZooKeeper connection timeout.
> the document describe wrong, and the code also has something wrong:
>  in ZkSecurityMigrator.scala,
>   val parser = new OptionParse()==>
> Any of --v, --ve, ... are accepted on the command line and treated as though 
> you had typed --verbose.
> To suppress this behavior, use the OptionParser constructor 
> OptionParser(boolean allowAbbreviations) and pass a value of false.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to