OmniSciDB  c07336695a
RebalanceCb Class Reference
+ Inheritance diagram for RebalanceCb:
+ Collaboration diagram for RebalanceCb:

Public Member Functions

void rebalance_cb (RdKafka::KafkaConsumer *consumer, RdKafka::ErrorCode err, std::vector< RdKafka::TopicPartition *> &partitions) override
 

Static Private Member Functions

static void part_list_print (const std::vector< RdKafka::TopicPartition *> &partitions)
 

Detailed Description

Definition at line 58 of file KafkaImporter.cpp.

Member Function Documentation

◆ part_list_print()

static void RebalanceCb::part_list_print ( const std::vector< RdKafka::TopicPartition *> &  partitions)
inlinestaticprivate

Definition at line 60 of file KafkaImporter.cpp.

References logger::INFO, and LOG.

Referenced by rebalance_cb().

60  {
61  for (unsigned int i = 0; i < partitions.size(); i++) {
62  LOG(INFO) << "\t" << partitions[i]->topic() << "[" << partitions[i]->partition()
63  << "]";
64  }
65  }
#define LOG(tag)
Definition: Logger.h:182
+ Here is the caller graph for this function:

◆ rebalance_cb()

void RebalanceCb::rebalance_cb ( RdKafka::KafkaConsumer *  consumer,
RdKafka::ErrorCode  err,
std::vector< RdKafka::TopicPartition *> &  partitions 
)
inlineoverride

Definition at line 68 of file KafkaImporter.cpp.

References eof_cnt, logger::INFO, LOG, part_list_print(), and partition_cnt.

70  {
71  LOG(INFO) << "RebalanceCb: " << RdKafka::err2str(err) << ": ";
72 
73  part_list_print(partitions);
74 
75  if (err == RdKafka::ERR__ASSIGN_PARTITIONS) {
76  consumer->assign(partitions);
77  partition_cnt = (int)partitions.size();
78  } else {
79  consumer->unassign();
80  partition_cnt = 0;
81  }
82  eof_cnt = 0;
83  }
static void part_list_print(const std::vector< RdKafka::TopicPartition *> &partitions)
static int eof_cnt
#define LOG(tag)
Definition: Logger.h:182
static int partition_cnt
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: