0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TableScannerHandler.cc
Go to the documentation of this file.
1 
20 #include "Common/Compat.h"
21 
22 #include "AsyncComm/Comm.h"
23 
24 #include "TableScannerHandler.h"
25 #include "TableScannerAsync.h"
26 
27 using namespace Hypertable;
28 
30  int32_t error;
31  try {
32  switch (m_event->type) {
33  case(Event::MESSAGE):
35  if (error == Error::REQUEST_TIMEOUT)
37  else if (error != Error::OK)
39  else
41  break;
42  case(Event::TIMER):
44  break;
45  case(Event::ERROR):
47  m_is_create);
48  break;
49  default:
50  HT_INFOF("Received event %s", m_event->to_str().c_str());
51  }
52  }
53  catch (Exception &e) {
54  HT_ERROR_OUT << e << HT_END;
55  m_scanner->cancel();
56  }
57 }
static int32_t response_code(const Event *event)
Returns the response code from an event event generated in response to a request message.
Definition: Protocol.cc:39
void handle_error(int scanner_id, int error, const std::string &error_msg, bool is_create)
Deal with errors.
void handle_timeout(int scanner_id, const std::string &error_msg, bool is_create)
Deal with timeouts.
Error event
Definition: Event.h:64
Compatibility Macros for C/C++.
virtual void run()
Carries out the request.
#define HT_END
Definition: Logger.h:220
#define HT_ERROR_OUT
Definition: Logger.h:301
Hypertable definitions
Declarations for Comm.
#define HT_INFOF(msg,...)
Definition: Logger.h:272
void cancel()
Cancels the scanner.
void handle_result(int scanner_id, EventPtr &event, bool is_create)
Deal with results of a scanner.
Request/response message event.
Definition: Event.h:63
Timer event
Definition: Event.h:65
This is a generic exception class for Hypertable.
Definition: Error.h:314
EventPtr m_event
MESSAGE Event from which handler was initialized.