Source:
public static void main(String[] args) { if (args.length < 5) { System.err.println("args: <ConfigFile> <userVisitsFile> <userVisitsFileOffset> <kMeansFile> <kMeansFileOffset> need to be specified!"); System.exit(1); } ConfigLoader configLoader = new ConfigLoader(args[0]); benchName = configLoader.getProperty("hibench.streamingbench.benchname").toLowerCase(); userVisitsFile = args[1]; userVisitsFileOffset = Long.parseLong(args[2]); kMeansFile = args[3]; kMeansFileOffset = Long.parseLong(args[4]); String topic = configLoader.getProperty("hibench.streamingbench.topic_name"); long recordPerInterval = Long.parseLong(configLoader.getProperty("hibench.streamingbench.prepare.periodic.recordPerInterval")); long totalCount = Long.parseLong(configLoader.getProperty("hibench.streamingbench.prepare.push.records")); int intervalSpan = Integer.parseInt(configLoader.getProperty("hibench.streamingbench.prepare.periodic.intervalSpan")); int totalRound = Integer.parseInt(configLoader.getProperty("hibench.streamingbench.prepare.periodic.totalRound")); KafkaSender sender; if(benchName.contains("statistics")) { sender = new KafkaSender(kMeansFile, kMeansFileOffset, configLoader, totalCount); } else { sender = new KafkaSender(userVisitsFile, userVisitsFileOffset, configLoader, totalCount); } Timer timer = new Timer(); timer.schedule(new RecordSendTask(sender, topic, recordPerInterval, totalRound, totalCount), 0, intervalSpan); System.out.println("Record Per Round: " + recordPerInterval); System.out.println("TotalRecord: " + totalCount); System.out.println("TotalRound: " + totalRound); System.out.println("Timer scheduled, interval is " + intervalSpan + " ms"); }

Target:
public static void main(String[] args) { if (args.length < 5) { System.err.println("args: <ConfigFile> <userVisitsFile> <userVisitsFileOffset> <kMeansFile> <kMeansFileOffset> need to be specified!"); System.exit(1); } ConfigLoader configLoader = new ConfigLoader(args[0]); benchName = configLoader.getProperty("hibench.streamingbench.benchname").toLowerCase(); userVisitsFile = args[1]; userVisitsFileOffset = Long.parseLong(args[2]); kMeansFile = args[3]; kMeansFileOffset = Long.parseLong(args[4]); String topic = configLoader.getProperty("hibench.streamingbench.topic_name"); long recordPerInterval = Long.parseLong(configLoader.getProperty("hibench.streamingbench.prepare.periodic.recordPerInterval")); long totalCount = Long.parseLong(configLoader.getProperty("hibench.streamingbench.prepare.push.records")); int intervalSpan = Integer.parseInt(configLoader.getProperty("hibench.streamingbench.prepare.periodic.intervalSpan")); int totalRound = Integer.parseInt(configLoader.getProperty("hibench.streamingbench.prepare.periodic.totalRound")); KafkaSender sender; if(benchName.contains("statistics")) { sender = new KafkaSender(kMeansFile, kMeansFileOffset, configLoader); } else { sender = new KafkaSender(userVisitsFile, userVisitsFileOffset, configLoader); } Timer timer = new Timer(); timer.schedule(new RecordSendTask(sender, topic, recordPerInterval, totalRound, totalCount), 0, intervalSpan); System.out.println("Record Per Round: " + recordPerInterval); System.out.println("TotalRecord: " + totalCount); System.out.println("TotalRound: " + totalRound); System.out.println("Timer scheduled, interval is " + intervalSpan + " ms"); }