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:
parent
f0e39cc330
commit
31a77a83ed
2 changed files with 134 additions and 39 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue