| 65 | ***********************************************************************/ |
| 66 | |
| 67 | RdKafka::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 |
no outgoing calls
no test coverage detected