public static void test() {
int spout_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPOUT_PARALLELISM_HINT), 1);
int split_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPLIT_PARALLELISM_HINT), 1);
int count_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_COUNT_PARALLELISM_HINT), 1);
TopologyBuilder builder = new TopologyBuilder();
boolean isLocalShuffle = JStormUtils.parseBoolean(conf.get("is.local.first.group"), false);
builder.setSpout("spout", new FastRandomSentenceSpout(), spout_Parallelism_hint);
if (isLocalShuffle) {
builder.setBolt("split", new SplitSentence(), split_Parallelism_hint).localFirstGrouping("spout");
} else {
builder.setBolt("split", new SplitSentence(), split_Parallelism_hint).shuffleGrouping("spout");
}
builder.setBolt("count", new WordCount()
.timeWindow(Time.seconds(1L), Time.milliseconds(500L))
.withStateSize(Time.hours(2)),
count_Parallelism_hint).fieldsGrouping("split", new Fields("word"));
String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
String topologyName = className[className.length - 1];
try {
JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
new JStormHelper.CheckAckedFail(conf), true);
} catch (Exception e) {
e.printStackTrace();
}
}