use of com.twitter.heron.integration_test.common.spout.PausedLocalFileSpout in project heron by twitter.
the class LocalReadWriteTopology method main.
public static void main(String[] args) throws Exception {
if (args.length < 3 || args.length > 4) {
throw new RuntimeException("Expects 3 or 4 arguments, topology name, " + "inputFile, outputFile and max emit count (optional)");
}
String topologyName = args[0];
String inputFile = args[1];
String outputFile = args[2];
TestTopologyBuilder builder = new TestTopologyBuilder(outputFile);
builder.setTerminalBoltClass(LOCAL_AGGREGATOR_BOLT_CLASS);
if (args.length == 3) {
builder.setSpout("paused-local-spout", new PausedLocalFileSpout(inputFile), 1);
} else {
int maxEmits = Integer.parseInt(args[3]);
builder.setSpout("paused-local-spout", new PausedLocalFileSpout(inputFile), 1, maxEmits);
}
builder.setBolt("identity-bolt", new IdentityBolt(new Fields("line")), 1).shuffleGrouping("paused-local-spout");
Config conf = new BasicConfig();
HeronSubmitter.submitTopology(topologyName, conf, builder.createTopology());
}
Aggregations