boolean isEnableSplit = JStormUtils.parseBoolean(
conf.get("enable.split"), false);
if (isEnableSplit == false) {
BoltDeclarer boltDeclarer = builder.setBolt(
SequenceTopologyDef.TOTAL_BOLT_NAME, new TotalCount(),
bolt_Parallelism_hint);
// localFirstGrouping is only for jstorm
// boltDeclarer.localFirstGrouping(SequenceTopologyDef.SEQUENCE_SPOUT_NAME);
boltDeclarer
.localOrShuffleGrouping(SequenceTopologyDef.SEQUENCE_SPOUT_NAME);
} else {
builder.setBolt(SequenceTopologyDef.SPLIT_BOLT_NAME,
new SplitRecord(), bolt_Parallelism_hint)
.localOrShuffleGrouping(
SequenceTopologyDef.SEQUENCE_SPOUT_NAME);
builder.setBolt(SequenceTopologyDef.TRADE_BOLT_NAME,
new PairCount(), bolt_Parallelism_hint).shuffleGrouping(
SequenceTopologyDef.SPLIT_BOLT_NAME,
SequenceTopologyDef.TRADE_STREAM_ID);
builder.setBolt(SequenceTopologyDef.CUSTOMER_BOLT_NAME,
new PairCount(), bolt_Parallelism_hint).shuffleGrouping(
SequenceTopologyDef.SPLIT_BOLT_NAME,
SequenceTopologyDef.CUSTOMER_STREAM_ID);
builder.setBolt(SequenceTopologyDef.MERGE_BOLT_NAME,
new MergeRecord(), bolt_Parallelism_hint)
.fieldsGrouping(SequenceTopologyDef.TRADE_BOLT_NAME,
new Fields("ID"))
.fieldsGrouping(SequenceTopologyDef.CUSTOMER_BOLT_NAME,
new Fields("ID"));
builder.setBolt(SequenceTopologyDef.TOTAL_BOLT_NAME,
new TotalCount(), bolt_Parallelism_hint).noneGrouping(
SequenceTopologyDef.MERGE_BOLT_NAME);
}
boolean kryoEnable = JStormUtils.parseBoolean(conf.get("kryo.enable"),
false);