Source:
<code>public static void main(String[] args) throws IOException { if (args.length != 9) { throw new RuntimeException( "Invalid arguments; Usage: java com.twitter.heron.ckptmgr.CheckpointManager " + "<topname> <topid> <ckptmgr_id> <myport> <stateful_config_filename> " + "<cluster> <role> <environ> <heron_internals_config_filename>"); } <START> String topologyName = args[0]; <END> String topologyId = args[1]; String ckptmgrId = args[2]; int port = Integer.parseInt(args[3]); String stateConfigFilename = args[4]; String cluster = args[5]; String role = args[6]; String environ = args[7]; SystemConfig systemConfig = SystemConfig.newBuilder(true).putAll(args[8], true).build(); CheckpointManagerConfig ckptmgrConfig = new CheckpointManagerConfig(stateConfigFilename); SingletonRegistry.INSTANCE.registerSingleton(SystemConfig.HERON_SYSTEM_CONFIG, systemConfig); Level loggingLevel = Level.INFO; String loggingDir = systemConfig.getHeronLoggingDirectory(); LoggingHelper.loggerInit(loggingLevel, true); LoggingHelper.addLoggingHandler( LoggingHelper.getFileHandler(ckptmgrId, loggingDir, true, systemConfig.getHeronLoggingMaximumSizeMb() * Constants.MB_TO_BYTES, systemConfig.getHeronLoggingMaximumFiles())); LoggingHelper.addLoggingHandler(new ErrorReportLoggingHandler()); LOG.info(String.format("Starting for topology %s with topologyId %s with " + "Id %s, Port: %d.", topologyName, topologyId, ckptmgrId, port)); LOG.info("System Config: " + systemConfig); CheckpointManager checkpointManager = new CheckpointManager(topologyName, topologyId, ckptmgrId, CHECKPOINT_MANAGER_HOST, port, systemConfig, ckptmgrConfig); checkpointManager.start(); LOG.info("Loops terminated. Exiting."); }</code><technical_language>pleae Options/CommandLineParser instead of positional fields. RuntimeManagerMain for examples</technical_language>

Target:
public static void main(String[] args) throws IOException, ParseException, CheckpointManagerException { Options options = constructOptions(); Options helpOptions = constructHelpOptions(); CommandLineParser parser = new DefaultParser(); CommandLine cmd = parser.parse(helpOptions, args, true); if (cmd.hasOption("h")) { usage(options); return; } try { cmd = parser.parse(options, args); } catch (ParseException e) { usage(options); throw new RuntimeException("Error parsing command line options ", e); } String topologyName = cmd.getOptionValue("topologyname"); String topologyId = cmd.getOptionValue("topologyid"); String ckptmgrId = cmd.getOptionValue("ckptmgrid"); int port = Integer.parseInt(cmd.getOptionValue("ckptmgrport")); String stateConfigFilename = cmd.getOptionValue("ckptmgrconfig"); String heronInternalConfig = cmd.getOptionValue("heroninternalconfig"); SystemConfig systemConfig = SystemConfig.newBuilder(true).putAll(heronInternalConfig, true).build(); CheckpointManagerConfig ckptmgrConfig = CheckpointManagerConfig.newBuilder(true).putAll(stateConfigFilename, true).build(); SingletonRegistry.INSTANCE.registerSingleton(SystemConfig.HERON_SYSTEM_CONFIG, systemConfig); Level loggingLevel = Level.INFO; String loggingDir = systemConfig.getHeronLoggingDirectory(); LoggingHelper.loggerInit(loggingLevel, true); LoggingHelper.addLoggingHandler( LoggingHelper.getFileHandler(ckptmgrId, loggingDir, true, systemConfig.getHeronLoggingMaximumSizeMb() * Constants.MB_TO_BYTES, systemConfig.getHeronLoggingMaximumFiles())); LoggingHelper.addLoggingHandler(new ErrorReportLoggingHandler()); LOG.info(String.format("Starting topology %s with topologyId %s with " + "Checkpoint Manager Id %s, Port: %d.", topologyName, topologyId, ckptmgrId, port)); LOG.info("System Config: " + systemConfig); CheckpointManager checkpointManager = new CheckpointManager(topologyName, topologyId, ckptmgrId, CHECKPOINT_MANAGER_HOST, port, systemConfig, ckptmgrConfig); checkpointManager.startAndLoop(); LOG.info("Loops terminated. Exiting."); }