OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventCb Class Reference
+ Inheritance diagram for EventCb:
+ Collaboration diagram for EventCb:

Public Member Functions

void event_cb (RdKafka::Event &event) override
 

Detailed Description

Definition at line 256 of file KafkaImporter.cpp.

Member Function Documentation

void EventCb::event_cb ( RdKafka::Event &  event)
inlineoverride

Definition at line 258 of file KafkaImporter.cpp.

References logger::ERROR, logger::INFO, LOG, run, and VLOG.

258  {
259  switch (event.type()) {
260  case RdKafka::Event::EVENT_ERROR:
261  LOG(ERROR) << "ERROR (" << RdKafka::err2str(event.err()) << "): " << event.str();
262  if (event.err() == RdKafka::ERR__ALL_BROKERS_DOWN) {
263  LOG(ERROR) << "All brokers are down, we may need special handling here";
264  run = false;
265  }
266  break;
267 
268  case RdKafka::Event::EVENT_STATS:
269  VLOG(2) << "\"STATS\": " << event.str();
270  break;
271 
272  case RdKafka::Event::EVENT_LOG:
273  LOG(INFO) << "LOG-" << event.severity() << "-" << event.fac().c_str() << ":"
274  << event.str().c_str();
275  break;
276 
277  case RdKafka::Event::EVENT_THROTTLE:
278  LOG(INFO) << "THROTTLED: " << event.throttle_time() << "ms by "
279  << event.broker_name() << " id " << (int)event.broker_id();
280  break;
281 
282  default:
283  LOG(INFO) << "EVENT " << event.type() << " (" << RdKafka::err2str(event.err())
284  << "): " << event.str();
285  break;
286  }
287  }
#define LOG(tag)
Definition: Logger.h:285
static bool run
#define VLOG(n)
Definition: Logger.h:388

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