You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Enis Soztutar (JIRA)" <ji...@apache.org> on 2017/03/28 20:53:42 UTC
[jira] [Resolved] (HBASE-17727) [C++] Make RespConverter work with
RawAsyncTableImpl
[ https://issues.apache.org/jira/browse/HBASE-17727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Enis Soztutar resolved HBASE-17727.
-----------------------------------
Resolution: Fixed
Fix Version/s: HBASE-14850
> [C++] Make RespConverter work with RawAsyncTableImpl
> ----------------------------------------------------
>
> Key: HBASE-17727
> URL: https://issues.apache.org/jira/browse/HBASE-17727
> Project: HBase
> Issue Type: Sub-task
> Reporter: Xiaobing Zhou
> Assignee: Enis Soztutar
> Fix For: HBASE-14850
>
> Attachments: hbase-17727-v1.patch
>
>
> 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.
> {code}
> template<typename R,
> typename S>
> using RespConverter = std::function<R(const S&)>;
> {code}
> {code}
> 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();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)