java - Kafka ReassignPartitionsCommand: IllegalArgumentException: long is not a value type -
i'm trying reassign partitions within project , i'm getting error.
2017-08-22 15:57:28 debug zookeeperbackedadoptionlogicimpl:320 - calling reassignpartitionscommand args:[--reassignment-json-file=partitions-to-move.json.1503417447767, --zookeeper=172.31.14.207:2181, --execute] java.lang.illegalargumentexception: long not value type @ joptsimple.internal.reflection.findconverter(reflection.java:66) @ joptsimple.argumentacceptingoptionspec.oftype(argumentacceptingoptionspec.java:111) @ kafka.admin.reassignpartitionscommand$reassignpartitionscommandoptions.<init>(reassignpartitionscommand.scala:301) @ kafka.admin.reassignpartitionscommand$.validateandparseargs(reassignpartitionscommand.scala:236) @ kafka.admin.reassignpartitionscommand$.main(reassignpartitionscommand.scala:34) @ kafka.admin.reassignpartitionscommand.main(reassignpartitionscommand.scala) @ rebalancer.core.zookeeperbackedadoptionlogicimpl.reassignpartitiontolocalbroker(zookeeperbackedadoptionlogicimpl.java:321) @ rebalancer.core.zookeeperbackedadoptionlogicimpl.adoptremotepartition(zookeeperbackedadoptionlogicimpl.java:267) @ rebalancer.core.zookeeperbackedadoptionlogicimpl.run(zookeeperbackedadoptionlogicimpl.java:118)
i create json file , use input reassign partitions. tried use same file builtin scripts of kafka , working.
kafka-reassign-partitions.bat --reassignment-json-file=partitions-to-move.json.1503417447767 --zookeeper=172.31.14.207:2181 --execute
i tried write simple program same code test same file , it's working well. happening json file , reset kafka environment before tests.
public class reassignpartition { private static curatorframework client; public static void main (string[] args) { client = curatorframeworkfactory.newclient(args[0] + ":2181", new exponentialbackoffretry(1000, 30)); client.start(); string reassignmentconfigfilename = args[1]; string[] reassigncmdargs = { "--reassignment-json-file=" + paths.get(reassignmentconfigfilename), "--zookeeper=" + client.getzookeeperclient().getcurrentconnectionstring(), "--execute" }; system.out.println("calling reassignpartitionscommand args:{}"+ arrays.tostring(reassigncmdargs)); reassignpartitionscommand.main(reassigncmdargs); } }
what problem?
update: json content
{"partitions":[{"topic":"test1","partition":0,"replicas":[1]}],"version":1}
it version mismatch.. 1 of pitfalls of working different versions. kafka 0.10.2.0 uses jopt-simple-4.9.jar , kafka 0.11.0.0 uses jopt-simple-5.0.4.jar
wiki
Comments
Post a Comment