0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Classes | Macros | Functions
ThriftBroker

Thrift broker. More...

Collaboration diagram for ThriftBroker:

Namespaces

 Hypertable
 Hypertable definitions
 
 Hypertable::ThriftBroker
 

Classes

class  Hypertable::MetricsHandler
 Collects and publishes Master metrics. More...
 
class  Hypertable::ThriftBroker::SharedMutatorMapKey
 
class  Hypertable::ThriftBroker::Context
 
class  Hypertable::ThriftBroker::ScannerInfo
 
struct  Hypertable::ThriftBroker::HqlCallback< ResultT, CellT >
 
class  Hypertable::ThriftBroker::ServerHandler
 
struct  Hypertable::ThriftBroker::ServerHandler::Statistics
 
class  Hypertable::ThriftBroker::ServerHandlerFactory
 
class  Hypertable::ThriftBroker::ThriftBrokerIfFactory
 

Macros

#define THROW_TE(_code_, _str_)
 
#define RETHROW(_expr_)
 
#define LOG_API_START(_expr_)
 
#define LOG_API_FINISH
 
#define LOG_API_FINISH_E(_expr_)
 
#define LOG_API(_expr_)
 
#define LOG_HQL_RESULT(_res_)
 
#define LOG_SLOW_QUERY(_pd_, _ns_, _hql_)
 
#define LOG_SLOW_QUERY_SCANNER(_scanner_, _ns_, _table_, _ss_)
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Thrift broker.

The ThriftBroker module contains the definition of the ThriftBroker.

Macro Definition Documentation

#define LOG_API (   _expr_)
Value:
do { \
if (m_context.log_api) \
std::cout << hires_ts <<" API "<< __func__ <<": "<< _expr_ << std::endl; \
} while (0)
ostream & hires_ts(ostream &out)
Prints the current time as seconds and nanoseconds, delimited by '.'.
Definition: Time.cc:45

Definition at line 140 of file ThriftBroker.cc.

#define LOG_API_FINISH
Value:
if (m_context.log_api || (g_log_slow_queries && scanner_info)) { \
if (m_context.log_api) \
std::cout << std::chrono::duration_cast<std::chrono::seconds>(start_time.time_since_epoch()).count() <<'.'<< std::setw(9) << std::setfill('0') << (std::chrono::duration_cast<std::chrono::nanoseconds>(start_time.time_since_epoch()).count() % 1000000000LL) <<" API "<< __func__ <<": "<< logging_stream.str() << " latency=" << std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count() << std::endl; \
if (scanner_info) \
scanner_info->latency += std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();\
}
static time_point now() noexcept
Definition: fast_clock.cc:37

Definition at line 121 of file ThriftBroker.cc.

#define LOG_API_FINISH_E (   _expr_)
Value:
if (m_context.log_api || (g_log_slow_queries && scanner_info)) { \
if (m_context.log_api) \
std::cout << std::chrono::duration_cast<std::chrono::seconds>(start_time.time_since_epoch()).count() <<'.'<< std::setw(9) << std::setfill('0') << (std::chrono::duration_cast<std::chrono::nanoseconds>(start_time.time_since_epoch()).count() % 1000000000LL) <<" API "<< __func__ <<": "<< logging_stream.str() << _expr_ << " latency=" << std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count() << std::endl; \
if (scanner_info)\
scanner_info->latency += std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();\
}
static time_point now() noexcept
Definition: fast_clock.cc:37

Definition at line 130 of file ThriftBroker.cc.

#define LOG_API_START (   _expr_)
Value:
std::chrono::fast_clock::time_point start_time, end_time; \
std::ostringstream logging_stream;\
ScannerInfoPtr scanner_info;\
g_metrics_handler->request_increment(); \
if (m_context.log_api || g_log_slow_queries) {\
start_time = std::chrono::fast_clock::now(); \
if (m_context.log_api)\
logging_stream << "API " << __func__ << ": " << _expr_;\
}
chrono::time_point< fast_clock > time_point
Definition: fast_clock.h:42
static time_point now() noexcept
Definition: fast_clock.cc:37
std::shared_ptr< ScannerInfo > ScannerInfoPtr

Definition at line 110 of file ThriftBroker.cc.

#define LOG_HQL_RESULT (   _res_)
Value:
do { \
if (m_context.log_api) \
cout << hires_ts <<" API "<< __func__ <<": result: "; \
if (Logger::logger->isDebugEnabled()) \
cout << _res_; \
else if (m_context.log_api) { \
if (_res_.__isset.results) \
cout <<"results.size=" << _res_.results.size(); \
if (_res_.__isset.cells) \
cout <<"cells.size=" << _res_.cells.size(); \
if (_res_.__isset.scanner) \
cout <<"scanner="<< _res_.scanner; \
if (_res_.__isset.mutator) \
cout <<"mutator="<< _res_.mutator; \
} \
cout << std::endl; \
} while(0)
ostream & hires_ts(ostream &out)
Prints the current time as seconds and nanoseconds, delimited by '.'.
Definition: Time.cc:45

Definition at line 145 of file ThriftBroker.cc.

#define LOG_SLOW_QUERY (   _pd_,
  _ns_,
  _hql_ 
)
Value:
do { \
if (g_log_slow_queries) { \
int64_t latency_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count(); \
if (latency_ms >= g_slow_query_latency_threshold) \
log_slow_query(__func__, start_time, end_time, latency_ms, _pd_, _ns_, _hql_); \
} \
} while(0)
static time_point now() noexcept
Definition: fast_clock.cc:37

Definition at line 163 of file ThriftBroker.cc.

#define LOG_SLOW_QUERY_SCANNER (   _scanner_,
  _ns_,
  _table_,
  _ss_ 
)
Value:
do { \
if (g_log_slow_queries) { \
ProfileDataScanner pd; \
_scanner_->get_profile_data(pd); \
int64_t latency_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count(); \
if (latency_ms >= g_slow_query_latency_threshold) \
log_slow_query_scanspec(__func__, start_time, end_time, latency_ms, pd, _ns_, _table_, _ss_); \
} \
} while(0)
static time_point now() noexcept
Definition: fast_clock.cc:37

Definition at line 172 of file ThriftBroker.cc.

#define RETHROW (   _expr_)
Value:
catch (Hypertable::Exception &e) { \
std::ostringstream oss; oss << HT_FUNC << " " << _expr_ << ": "<< e; \
HT_ERROR_OUT << oss.str() << HT_END; \
oss.str(""); \
oss << _expr_; \
g_metrics_handler->error_increment(); \
THROW_TE(e.code(), oss.str()); \
}
#define HT_FUNC
Definition: compat-c.h:65
#define THROW_TE(_code_, _str_)
Definition: ThriftBroker.cc:92
#define HT_END
Definition: Logger.h:220
#define HT_ERROR_OUT
Definition: Logger.h:301
This is a generic exception class for Hypertable.
Definition: Error.h:314

Definition at line 101 of file ThriftBroker.cc.

#define THROW_TE (   _code_,
  _str_ 
)
Value:
do { ThriftGen::ClientException te; \
te.code = _code_; \
te.message.append(Error::get_text(_code_)); \
te.message.append(" - "); \
te.message.append(_str_); \
te.__isset.code = te.__isset.message = true; \
throw te; \
} while (0)
const char * get_text(int error)
Returns a descriptive error message.
Definition: Error.cc:330

Definition at line 92 of file ThriftBroker.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 3140 of file ThriftBroker.cc.