mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-10-31 18:47:48 +00:00
Add compile guard for rd_kafka_event_stats
This commit is contained in:
@@ -121,12 +121,16 @@ public:
|
||||
*/
|
||||
void* get_opaque() const;
|
||||
|
||||
#if RD_KAFKA_VERSION >= RD_KAFKA_EVENT_STATS_SUPPORT_VERSION
|
||||
/**
|
||||
* \brief Gets the stats in this event
|
||||
*
|
||||
* This call is only valid if the event type is RD_KAFKA_EVENT_STATS
|
||||
*/
|
||||
std::string get_stats() const;
|
||||
std::string get_stats() const {
|
||||
return rd_kafka_event_stats(handle_.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Gets the topic/partition for this event
|
||||
|
||||
@@ -48,5 +48,6 @@
|
||||
#define RD_KAFKA_HEADERS_SUPPORT_VERSION 0x000b0402 //v0.11.4.02
|
||||
#define RD_KAFKA_ADMIN_API_SUPPORT_VERSION 0x000b0500 //v0.11.5.00
|
||||
#define RD_KAFKA_MESSAGE_LATENCY_SUPPORT_VERSION 0x000b0000 //v0.11.0.00
|
||||
#define RD_KAFKA_EVENT_STATS_SUPPORT_VERSION 0x000b0000 //v0.11.0.00
|
||||
|
||||
#endif // CPPKAFKA_MACROS_H
|
||||
|
||||
@@ -73,10 +73,6 @@ void* Event::get_opaque() const {
|
||||
return rd_kafka_event_opaque(handle_.get());
|
||||
}
|
||||
|
||||
string Event::get_stats() const {
|
||||
return rd_kafka_event_stats(handle_.get());
|
||||
}
|
||||
|
||||
TopicPartition Event::get_topic_partition() const {
|
||||
using TopparHandle = unique_ptr<rd_kafka_topic_partition_t,
|
||||
decltype(&rd_kafka_topic_partition_destroy)>;
|
||||
|
||||
Reference in New Issue
Block a user