OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 257 of file KafkaImporter.cpp.

Member Function Documentation

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

Definition at line 259 of file KafkaImporter.cpp.

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

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

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