for example:
1. I use thrift2 put to access table,
try{
_client->putMultiple(table, tput_vec); //table is 'member'
} catch (TTransportException &e) {
ret = e.getType(); //2 or 3
g_logger.warn("[%s:%d] [%s] [PUT] TTransportException fail: %s:%d",
_thrift_ip, _thrift_port, table.c_str(), e.what(), ret);
} catch (TException &e) {
g_logger.error("[%s:%d] [%s] [PUT] fatal error: %s, stop",
_thrift_ip, _thrift_port, table.c_str(), e.what());
ret = -1;
}
if I disable the table 'member', the code can catch TTransportException:
[27560] 28 Feb 10:25:22 [WARN] [1130428752] [bus_hbase_util.cc:_put_multiple]
[95] [10.13.2.194:9091] [member] [PUT] TTransportException fail: EAGAIN (timed
out):2
2. I use thrfit2 increment to access table,
try{
//increment没有批量的接口
_client->increment(tresult, table, tincrement);
} catch (ATP::TProtocolException &e) {
ret = e.getType();
g_logger.warn("[%s:%d] [%s] [INCREMENT]
TTransportException: %s:%d",
_thrift_ip, _thrift_port, table.c_str(), e.what(),
ret);
goto error_out;
} catch (AT::TApplicationException &e) {
ret = e.getType();
g_logger.warn("[%s:%d] [%s] [INCREMENT]
TTransportException: %s:%d",
_thrift_ip, _thrift_port, table.c_str(), e.what(),
ret);
goto error_out;
} catch (ATT::TTransportException &e) {
ret = e.getType();
g_logger.warn("[%s:%d] [%s] [INCREMENT]
TTransportException: %s:%d",
_thrift_ip, _thrift_port, table.c_str(), e.what(),
ret);
goto error_out;
} catch (AT::TException &e) {
g_logger.error("[%s:%d] [%s] [INCREMENT] %s %s:%s %d fatal
error: %s, stop",
_thrift_ip, _thrift_port,
table.c_str(),
hrow->get_hbase_row(),
hrow->get_hbase_cf(),
hrow->get_hbase_qu(),
hrow->get_hbase_increment(),
e.what());
ret = -1; goto error_out;
}
if I disable the table 'member', the code can only catch TException:
[27560] 28 Feb 10:00:35 [ERROR] [1105250640] [bus_hbase_util.cc:send_to_hbase]
[233] [10.13.2.194:9091] [member] [INCREMENT] counter cf:count 1 fatal error:
Default TException., stop
WHY I can not catch TTransportException in condition 2, and I can catch
TTransportException in condition 1? Or something wrong with
THBaseServiceClient::increment() throw exception ?