use of org.openkilda.wfm.share.zk.ZooKeeperBolt in project open-kilda by telstra.
the class PingTopology method zooKeeperBolt.
private void zooKeeperBolt(TopologyBuilder topology) {
ZooKeeperBolt zooKeeperBolt = new ZooKeeperBolt(getConfig().getBlueGreenMode(), getZkTopoName(), getZookeeperConfig(), getBoltInstancesCount(InputRouter.BOLT_ID, TickDeduplicator.BOLT_ID));
declareBolt(topology, zooKeeperBolt, ZooKeeperBolt.BOLT_ID).allGrouping(InputRouter.BOLT_ID, InputRouter.STREAM_ZOOKEEPER).allGrouping(TickDeduplicator.BOLT_ID, TickDeduplicator.STREAM_ZOOKEEPER);
}
use of org.openkilda.wfm.share.zk.ZooKeeperBolt in project open-kilda by telstra.
the class ControlTopology method zooKeeperBolt.
private void zooKeeperBolt(TopologyBuilder topology) {
ZooKeeperBolt zooKeeperBolt = new ZooKeeperBolt(getConfig().getBlueGreenMode(), getZkTopoName(), getZookeeperConfig(), getBoltInstancesCount(Router.BOLT_ID));
declareBolt(topology, zooKeeperBolt, ZooKeeperBolt.BOLT_ID).allGrouping(Router.BOLT_ID, ZkStreams.ZK.toString());
}
use of org.openkilda.wfm.share.zk.ZooKeeperBolt in project open-kilda by telstra.
the class IslLatencyTopology method createZooKeeperBolt.
private void createZooKeeperBolt(TopologyBuilder builder) {
ZooKeeperBolt zooKeeperBolt = new ZooKeeperBolt(getConfig().getBlueGreenMode(), getZkTopoName(), getZookeeperConfig(), getBoltInstancesCount(ROUTER_BOLT_ID, ISL_STATUS_UPDATE_BOLT_ID));
declareBolt(builder, zooKeeperBolt, ZooKeeperBolt.BOLT_ID).allGrouping(ROUTER_BOLT_ID, ZkStreams.ZK.toString()).allGrouping(ISL_STATUS_UPDATE_BOLT_ID, ZkStreams.ZK.toString());
}
use of org.openkilda.wfm.share.zk.ZooKeeperBolt in project open-kilda by telstra.
the class SwitchManagerTopology method createTopology.
@Override
public StormTopology createTopology() {
logger.info("Creating SwitchManagerTopology - {}", topologyName);
TopologyBuilder builder = new TopologyBuilder();
ZooKeeperSpout zooKeeperSpout = new ZooKeeperSpout(getConfig().getBlueGreenMode(), getZkTopoName(), getZookeeperConfig());
declareSpout(builder, zooKeeperSpout, ZooKeeperSpout.SPOUT_ID);
declareSpout(builder, new CoordinatorSpout(), CoordinatorSpout.ID);
declareBolt(builder, new CoordinatorBolt(), CoordinatorBolt.ID).allGrouping(CoordinatorSpout.ID).fieldsGrouping(SwitchManagerHub.ID, CoordinatorBolt.INCOME_STREAM, FIELDS_KEY);
PersistenceManager persistenceManager = new PersistenceManager(configurationProvider);
HubBolt.Config hubConfig = HubBolt.Config.builder().requestSenderComponent(HUB_SPOUT).workerComponent(SpeakerWorkerBolt.ID).lifeCycleEventComponent(ZooKeeperSpout.SPOUT_ID).timeoutMs((int) TimeUnit.SECONDS.toMillis(topologyConfig.getProcessTimeout())).build();
List<String> inputTopics = Lists.newArrayList(topologyConfig.getKafkaSwitchManagerNbTopic(), topologyConfig.getKafkaSwitchManagerNetworkTopic(), topologyConfig.getKafkaSwitchManagerNbWorkerTopic());
declareKafkaSpout(builder, inputTopics, HUB_SPOUT);
declareBolt(builder, new SwitchManagerHub(hubConfig, persistenceManager, topologyConfig, configurationProvider.getConfiguration(FlowResourcesConfig.class), configurationProvider.getConfiguration(RuleManagerConfig.class)), SwitchManagerHub.ID).allGrouping(ZooKeeperSpout.SPOUT_ID).fieldsGrouping(HUB_SPOUT, FIELDS_KEY).directGrouping(SpeakerWorkerBolt.ID, SwitchManagerHub.INCOME_STREAM).directGrouping(CoordinatorBolt.ID);
WorkerBolt.Config speakerWorkerConfig = WorkerBolt.Config.builder().hubComponent(SwitchManagerHub.ID).streamToHub(SwitchManagerHub.INCOME_STREAM).workerSpoutComponent(WORKER_SPOUT).defaultTimeout((int) TimeUnit.SECONDS.toMillis(topologyConfig.getOperationTimeout())).build();
declareKafkaSpout(builder, Lists.newArrayList(topologyConfig.getKafkaSwitchManagerTopic(), topologyConfig.getGrpcResponseTopic()), WORKER_SPOUT);
declareBolt(builder, new SpeakerWorkerBolt(speakerWorkerConfig), SpeakerWorkerBolt.ID).fieldsGrouping(WORKER_SPOUT, FIELDS_KEY).fieldsGrouping(SwitchManagerHub.ID, SpeakerWorkerBolt.INCOME_STREAM, FIELDS_KEY).directGrouping(CoordinatorBolt.ID);
declareBolt(builder, buildKafkaBolt(topologyConfig.getKafkaNorthboundTopic()), NB_KAFKA_BOLT).shuffleGrouping(SwitchManagerHub.ID, StreamType.TO_NORTHBOUND.toString());
declareBolt(builder, buildKafkaBolt(topologyConfig.getKafkaSpeakerTopic()), SPEAKER_KAFKA_BOLT).shuffleGrouping(SpeakerWorkerBolt.ID, StreamType.TO_FLOODLIGHT.toString());
declareBolt(builder, buildKafkaBolt(topologyConfig.getGrpcSpeakerTopic()), GRPC_SPEAKER_KAFKA_BOLT).shuffleGrouping(SpeakerWorkerBolt.ID, StreamType.TO_GRPC.toString());
ZooKeeperBolt zooKeeperBolt = new ZooKeeperBolt(getConfig().getBlueGreenMode(), getZkTopoName(), getZookeeperConfig(), getBoltInstancesCount(SwitchManagerHub.ID));
declareBolt(builder, zooKeeperBolt, ZooKeeperBolt.BOLT_ID).allGrouping(SwitchManagerHub.ID, ZkStreams.ZK.toString());
metrics(builder);
return builder.createTopology();
}
Aggregations