1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

convert metadata to partitions

This commit is contained in:
winlin 2015-10-22 14:22:10 +08:00
parent f0e39cc330
commit 31a77a83ed
2 changed files with 134 additions and 39 deletions

View file

@ -29,6 +29,8 @@
*/
#include <srs_core.hpp>
#include <vector>
class SrsLbRoundRobin;
class SrsAsyncCallWorker;
class SrsTcpClient;
@ -38,6 +40,26 @@ class SrsKafkaClient;
#ifdef SRS_AUTO_KAFKA
/**
* the kafka partition info.
*/
struct SrsKafkaPartition
{
private:
std::string ep;
public:
int id;
// leader.
int broker;
std::string host;
int port;
public:
SrsKafkaPartition();
virtual ~SrsKafkaPartition();
public:
virtual std::string hostport();
};
/**
* the kafka producer used to save log to kafka cluster.
*/
@ -49,6 +71,8 @@ private:
private:
bool meatadata_ok;
st_cond_t metadata_expired;
public:
std::vector<SrsKafkaPartition*> partitions;
private:
SrsLbRoundRobin* lb;
SrsAsyncCallWorker* worker;