Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-14850 C++ client implementation
  3. HBASE-17727

[C++] Make RespConverter work with RawAsyncTableImpl

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • HBASE-14850
    • 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

        1. hbase-17727-v1.patch
          9 kB
          Enis Soztutar

        Issue Links

          Activity

            People

              enis Enis Soztutar
              xiaobingo Xiaobing Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: