public static void main(String[] args) throws Exception { CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); if (cmd.getOptions().length == 0 || cmd.hasOption("help")) { HelpFormatter f = new HelpFormatter(); f.printHelp("OptionsTip", ManagerConf.constructManagerOptions()); System.exit(0); } final ManagerStarter managerStarter = ManagerStarter.init(cmd); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { managerStarter.stop(); } catch (Exception e) { LOGGER.error("Caught error during shutdown! ", e); } } }); try { managerStarter.start(); } catch (Exception e) { LOGGER.error("Cannot start uReplicator-Manager: ", e); } }
}; CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); conf.addProperty("kafka.cluster.zkStr.cluster1", ZkStarter.DEFAULT_ZK_STR + "/cluster1");
CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.fail("Expected exception to be thrown"); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.fail("Expected exception to be thrown"); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.fail("Expected exception to be thrown"); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.fail("Expected exception to be thrown"); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.fail("Expected exception to be thrown"); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Assert.assertTrue(conf.getSourceClusters().isEmpty());
}; CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args); ManagerConf conf = ManagerConf.getManagerConf(cmd); Set<String> ret1 = new HashSet<>();