Search in sources :

Example 1 with RouteBolt

use of org.openkilda.wfm.ctrl.RouteBolt in project open-kilda by telstra.

the class AbstractTopology method createCtrlBranch.

protected void createCtrlBranch(TopologyBuilder builder, List<CtrlBoltRef> targets) throws StreamNameCollisionException {
    checkAndCreateTopic(config.getKafkaCtrlTopic());
    KafkaSpout kafkaSpout;
    kafkaSpout = createKafkaSpout(config.getKafkaCtrlTopic(), SPOUT_ID_CTRL);
    builder.setSpout(SPOUT_ID_CTRL, kafkaSpout);
    RouteBolt route = new RouteBolt(getTopologyName());
    builder.setBolt(BOLT_ID_CTRL_ROUTE, route).shuffleGrouping(SPOUT_ID_CTRL);
    KafkaBolt kafkaBolt = createKafkaBolt(config.getKafkaCtrlTopic());
    BoltDeclarer outputSetup = builder.setBolt(BOLT_ID_CTRL_OUTPUT, kafkaBolt).shuffleGrouping(BOLT_ID_CTRL_ROUTE, route.STREAM_ID_ERROR);
    for (CtrlBoltRef ref : targets) {
        String boltId = ref.getBoltId();
        ref.getDeclarer().allGrouping(BOLT_ID_CTRL_ROUTE, route.registerEndpoint(boltId));
        outputSetup.shuffleGrouping(boltId, ref.getBolt().getCtrlStreamId());
    }
}
Also used : CtrlBoltRef(org.openkilda.wfm.CtrlBoltRef) BoltDeclarer(org.apache.storm.topology.BoltDeclarer) RouteBolt(org.openkilda.wfm.ctrl.RouteBolt) KafkaSpout(org.apache.storm.kafka.spout.KafkaSpout) KafkaBolt(org.apache.storm.kafka.bolt.KafkaBolt)

Aggregations

KafkaBolt (org.apache.storm.kafka.bolt.KafkaBolt)1 KafkaSpout (org.apache.storm.kafka.spout.KafkaSpout)1 BoltDeclarer (org.apache.storm.topology.BoltDeclarer)1 CtrlBoltRef (org.openkilda.wfm.CtrlBoltRef)1 RouteBolt (org.openkilda.wfm.ctrl.RouteBolt)1