// generate inputs
Map<GlobalStreamId, Grouping> inputs = acker_inputs(ret);
// generate acker which will be stored in topology
Bolt acker_bolt = Thrift.mkAckerBolt(inputs, ackerbolt, outputs,
ackerNum);
// add every bolt two output stream
// ACKER_ACK_STREAM_ID/ACKER_FAIL_STREAM_ID
for (Entry<String, Bolt> e : ret.get_bolts().entrySet()) {
Bolt bolt = e.getValue();
ComponentCommon common = bolt.get_common();
List<String> ackList = JStormUtils.mk_list("id", "ack-val");
common.put_to_streams(ACKER_ACK_STREAM_ID,
Thrift.outputFields(ackList));
List<String> failList = JStormUtils.mk_list("id");
common.put_to_streams(ACKER_FAIL_STREAM_ID,
Thrift.outputFields(failList));
bolt.set_common(common);
}
// add every spout output stream ACKER_INIT_STREAM_ID
// add every spout two intput source
// ((ACKER_COMPONENT_ID, ACKER_ACK_STREAM_ID), directGrouping)
// ((ACKER_COMPONENT_ID, ACKER_FAIL_STREAM_ID), directGrouping)
for (Entry<String, SpoutSpec> kv : ret.get_spouts().entrySet()) {
SpoutSpec bolt = kv.getValue();
ComponentCommon common = bolt.get_common();
List<String> initList = JStormUtils.mk_list("id", "init-val",
"spout-task");
common.put_to_streams(ACKER_INIT_STREAM_ID,
Thrift.outputFields(initList));