Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This is a follow up work of HBASE-17465.
There's a problem to dereference instance of RpcCallback when it's passed as function argument.
template<typename R,
typename S>
using RespConverter = std::function<R(const S&)>;
template<typename REQ, typename PREQ, typename PRESP, typename RESP> folly::Future<RESP> Call( std::shared_ptr<hbase::RpcClient> rpc_client, std::shared_ptr<HBaseRpcController> controller, std::shared_ptr<RegionLocation> loc, const REQ& req, const ReqConverter<std::unique_ptr<PREQ>, REQ, std::string>& req_converter, const hbase::RpcCall<PREQ, PRESP, hbase::RpcClient>& rpc_call, const RespConverter<std::unique_ptr<RESP>, PRESP>& resp_converter) { rpc_call( rpc_client, loc, controller, std::move(req_converter(req, loc->region_name()))) .then([&, this](std::unique_ptr<PRESP> presp) { // std::unique_ptr<hbase::Result> result = resp_converter(presp); std::unique_ptr<hbase::Result> result = hbase::ResponseConverter::FromGetResponse(*presp); promise_->setValue(std::move(*result)); }) .onError([this] (const std::exception& e) {promise_->setException(e);}); return promise_->getFuture(); }
Attachments
Attachments
Issue Links
- is related to
-
HBASE-17465 [C++] implement request retry mechanism over RPC
- Closed