MCPcopy Create free account
hub / github.com/SNAS/openbmp / getTopic

Method getTopic

Server/src/kafka/KafkaTopicSelector.cpp:67–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 ***********************************************************************/
66
67RdKafka::Topic * KafkaTopicSelector::getTopic(const std::string &topic_var,
68 const std::string *router_group, const std::string *peer_group,
69 uint32_t peer_asn) {
70
71 // Update the topic key based on the peer_group/router_group
72 std::string topic_key = getTopicKey(topic_var, router_group, peer_group, peer_asn);
73
74 topic_map::iterator t_it;
75
76 if ( (t_it=topic.find(topic_key)) != topic.end()) {
77 return t_it->second; // Return the existing initialized topic
78 }
79 else {
80 SELF_DEBUG("Requesting to create topic for key=%s", topic_key.c_str());
81 return initTopic(topic_var, router_group, peer_group, peer_asn); // create and return newly created topic
82 }
83
84 return NULL;
85}
86
87/*********************************************************************//**
88 * Check if a topic is enabled

Callers 2

produceMethod · 0.80
send_bmp_rawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected