AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
|
Kafka class is a class that is responsible to send all generated output data, via Apache Kafka technology to the next AI Watch module. More...
#include <KafkaManager.hpp>
Public Member Functions | |
KafkaManager (const char *topic) | |
Construct a new Kafka Manager object. More... | |
~KafkaManager (void) | |
Destroy the KafkaManager object. More... | |
void | sendData (const char *key, Json::Value root) |
Send data contained in root via Kafka with ID equal to key. More... | |
Private Member Functions | |
void | setProducer (rd_kafka_t *producer) |
Set the Kafka producer's instance. More... | |
void | setConfiguration (rd_kafka_conf_t *configuration) |
Set the Kafka's configuration. More... | |
rd_kafka_t * | getProducer (void) |
Get the Kafka producer's instance. More... | |
rd_kafka_conf_t * | getConfiguration (void) |
Get the Kafka's configuration. More... | |
const char * | getTopic (void) |
Get the destination Kafka's topic. More... | |
void | loadConfigurationGroup (rd_kafka_conf_t *conf, GKeyFile *key_file, const char *group) |
Loads the configuration from Kafka's configuration file. More... | |
int | getArraySize (const char **array) |
Get the "const char *" array size. More... | |
void | setupProducer (void) |
Launches configuration loading, once reads all the configuration parameters and later set the producer instance. More... | |
Static Private Member Functions | |
static void | dr_msg_cb (rd_kafka_t *kafka_handle, const rd_kafka_message_t *rkmessage, void *opaque) |
Optional per-message delivery callback (triggered by poll() or flush()) when a message has been successfully delivered or permanently failed delivery (after retries). More... | |
Private Attributes | |
rd_kafka_t * | producer |
Kafka producer's instance. More... | |
rd_kafka_conf_t * | configuration |
Kafka's configuration. More... | |
const char * | topic |
Destination Kafka's topic. More... | |
Kafka class is a class that is responsible to send all generated output data, via Apache Kafka technology to the next AI Watch module.
Definition at line 26 of file KafkaManager.hpp.
|
inline |
Construct a new Kafka Manager object.
topic | Destination Kafka's topic. |
Definition at line 107 of file KafkaManager.hpp.
References setupProducer().
KafkaManager::~KafkaManager | ( | void | ) |
Destroy the KafkaManager object.
Definition at line 87 of file KafkaManager.cpp.
References getProducer(), and setConfiguration().
|
staticprivate |
Optional per-message delivery callback (triggered by poll() or flush()) when a message has been successfully delivered or permanently failed delivery (after retries).
kafka_handle | |
rkmessage | |
opaque |
Definition at line 56 of file KafkaManager.cpp.
Referenced by setupProducer().
|
private |
Get the "const char *" array size.
array |
Definition at line 52 of file KafkaManager.cpp.
|
private |
Get the Kafka's configuration.
Definition at line 27 of file KafkaManager.cpp.
References configuration.
Referenced by setupProducer().
|
private |
Get the Kafka producer's instance.
Definition at line 23 of file KafkaManager.cpp.
References producer.
Referenced by sendData(), setupProducer(), and ~KafkaManager().
|
private |
Get the destination Kafka's topic.
Definition at line 31 of file KafkaManager.cpp.
References topic.
Referenced by sendData().
|
private |
Loads the configuration from Kafka's configuration file.
conf | |
key_file | |
group |
Definition at line 35 of file KafkaManager.cpp.
References RDKAFKA_CONF_SET_ERROR, RDKAFKA_CONF_SET_SCOPE, RDKAFKA_GET_KEY_FROM_JSON_ERROR, RDKAFKA_GET_KEY_FROM_JSON_SCOPE, RDKAFKA_GET_KEYS_FROM_JSON_ERROR, and RDKAFKA_GET_KEYS_FROM_JSON_SCOPE.
Referenced by setupProducer().
void KafkaManager::sendData | ( | const char * | key, |
Json::Value | root | ||
) |
Send data contained in root via Kafka with ID equal to key.
key | |
root |
Definition at line 92 of file KafkaManager.cpp.
References getProducer(), getTopic(), producer, and topic.
Referenced by FacadeSingleton::sendData().
|
private |
Set the Kafka's configuration.
configuration | Kafka's configuration. |
Definition at line 19 of file KafkaManager.cpp.
References configuration.
Referenced by setupProducer(), and ~KafkaManager().
|
private |
Set the Kafka producer's instance.
producer | Kafka producer's instance. |
Definition at line 15 of file KafkaManager.cpp.
References producer.
Referenced by setupProducer().
|
private |
Launches configuration loading, once reads all the configuration parameters and later set the producer instance.
Definition at line 60 of file KafkaManager.cpp.
References dr_msg_cb(), getConfiguration(), getProducer(), loadConfigurationGroup(), setConfiguration(), and setProducer().
Referenced by KafkaManager().
|
private |
Kafka's configuration.
Definition at line 35 of file KafkaManager.hpp.
Referenced by getConfiguration(), and setConfiguration().
|
private |
Kafka producer's instance.
Definition at line 31 of file KafkaManager.hpp.
Referenced by getProducer(), sendData(), and setProducer().
|
private |
Destination Kafka's topic.
Definition at line 39 of file KafkaManager.hpp.
Referenced by getTopic(), and sendData().