use of org.apache.storm.kafka.bolt.KafkaBolt in project open-kilda by telstra.
the class AbstractTopology method makeKafkaBolt.
protected <V> KafkaBolt<String, V> makeKafkaBolt(Class<? extends Serializer<V>> valueEncoder) {
Properties properties = getKafkaProducerProperties();
properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, valueEncoder.getName());
return new KafkaBolt<String, V>().withProducerProperties(properties).withTupleToKafkaMapper(new FieldNameBasedTupleToKafkaMapper<>());
}
use of org.apache.storm.kafka.bolt.KafkaBolt in project open-kilda by telstra.
the class IslStatsTopology method createTopology.
public StormTopology createTopology() {
final String clazzName = this.getClass().getSimpleName();
final String spoutName = "islstats-spout";
logger.debug("Building Topology - {}", clazzName);
TopologyBuilder builder = new TopologyBuilder();
String topic = config.getKafkaTopoDiscoTopic();
checkAndCreateTopic(topic);
logger.debug("connecting to {} topic", topic);
builder.setSpout(spoutName, createKafkaSpout(topic, clazzName));
final String verifyIslStatsBoltName = IslStatsBolt.class.getSimpleName();
IslStatsBolt verifyIslStatsBolt = new IslStatsBolt();
logger.debug("starting {} bolt", verifyIslStatsBoltName);
builder.setBolt(verifyIslStatsBoltName, verifyIslStatsBolt, config.getParallelism()).shuffleGrouping(spoutName);
final String openTsdbTopic = config.getKafkaOtsdbTopic();
checkAndCreateTopic(openTsdbTopic);
KafkaBolt openTsdbBolt = createKafkaBolt(openTsdbTopic);
builder.setBolt("isl-stats-opentsdb", openTsdbBolt, config.getParallelism()).shuffleGrouping(verifyIslStatsBoltName);
return builder.createTopology();
}
use of org.apache.storm.kafka.bolt.KafkaBolt in project open-kilda by telstra.
the class NetworkTopology method outputStatus.
private void outputStatus(TopologyBuilder topology) {
StatusEncoder bolt = new StatusEncoder();
declareBolt(topology, bolt, StatusEncoder.BOLT_ID).shuffleGrouping(IslHandler.BOLT_ID, IslHandler.STREAM_STATUS_ID);
KafkaBolt output = buildKafkaBolt(kafkaTopics.getNetworkIslStatusTopic());
declareBolt(topology, output, ComponentId.STATUS_OUTPUT.toString()).shuffleGrouping(StatusEncoder.BOLT_ID);
}
use of org.apache.storm.kafka.bolt.KafkaBolt in project open-kilda by telstra.
the class NetworkTopology method outputSpeakerRules.
private void outputSpeakerRules(TopologyBuilder topology) {
SpeakerRulesEncoder encoderRules = new SpeakerRulesEncoder();
declareBolt(topology, encoderRules, SpeakerRulesEncoder.BOLT_ID).shuffleGrouping(SpeakerRulesWorker.BOLT_ID);
KafkaBolt outputRules = buildKafkaBolt(kafkaTopics.getSpeakerTopic());
declareBolt(topology, outputRules, ComponentId.SPEAKER_RULES_OUTPUT.toString()).shuffleGrouping(SpeakerRulesEncoder.BOLT_ID);
}
use of org.apache.storm.kafka.bolt.KafkaBolt in project open-kilda by telstra.
the class NetworkTopology method outputSpeaker.
private void outputSpeaker(TopologyBuilder topology) {
SpeakerEncoder bolt = new SpeakerEncoder();
declareBolt(topology, bolt, SpeakerEncoder.BOLT_ID).shuffleGrouping(WatcherHandler.BOLT_ID, WatcherHandler.STREAM_SPEAKER_ID).shuffleGrouping(BfdWorker.BOLT_ID, BfdWorker.STREAM_SPEAKER_ID);
KafkaBolt output = buildKafkaBolt(kafkaTopics.getSpeakerDiscoTopic());
declareBolt(topology, output, ComponentId.SPEAKER_OUTPUT.toString()).shuffleGrouping(SpeakerEncoder.BOLT_ID);
}
Aggregations