hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enis Soztutar (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HBASE-17754) [C++] RawAsyncTable
Date Wed, 15 Mar 2017 22:07:41 GMT

    [ https://issues.apache.org/jira/browse/HBASE-17754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926857#comment-15926857
] 

Enis Soztutar edited comment on HBASE-17754 at 3/15/17 10:07 PM:
-----------------------------------------------------------------

Thanks for the new patch.

# We should keep the unit test. client-test is like system test.
# I was referring this
{noformat}
std::pair<std::shared_ptr<AsyncSingleRequestRpcRetryingCaller<std::shared_ptr<Result>>>,
  Future<std::shared_ptr<Result>>>  Get(const hbase::Get& get);
{noformat}
Why do we need the std::pair? Can we simplify this?
# This is the sequence of call
{noformat}
template <typename RESP>
std::shared_ptr<SingleRequestCallerBuilder<RESP>> RawAsyncTable::CreateCallerBuilder
{noformat}
returns builder, and builder->build() returns AsyncSingleRequestRpcRetryingCaller<RESP>,
then AsyncSingleRequestRpcRetryingCaller<RESP>.call() returns RESP which is the hbase::Result.
# you may need to do cast like this, std::shared_ptr itself is agnostic of polymorphism of
the enclosed type.
{noformat}
115	std::shared_ptr<RpcChannel> RpcClient::CreateRpcChannel(const std::string &host,
116	    uint16_t port, std::shared_ptr<User> ticket, int rpc_timeout) {
117	
118	  std::shared_ptr<RpcChannelImplementation> channel = std::make_shared<
119	      RpcChannelImplementation>(shared_from_this(), host, port, ticket,
120	      rpc_timeout);
121	
122	  /* static_pointer_cast is safe since RpcChannelImplementation derives
123	   * from RpcChannel, otherwise, dynamic_pointer_cast should be used. */
124	  return std::static_pointer_cast<RpcChannel>(channel);
125	}
{noformat}
Otherwise, v2 looks fine.


was (Author: xiaobingo):
Thanks for the new patch.

# We should keep the unit test. client-test is like system test.
# I was referring this
{noformat}
std::pair<std::shared_ptr<AsyncSingleRequestRpcRetryingCaller<std::shared_ptr<Result>>>,
  Future<std::shared_ptr<Result>>>  Get(const hbase::Get& get);
{noformat}
Why do we need the std::pair? Can we simplify this?
# This is the sequence of call
{noformat}
template <typename RESP>
std::shared_ptr<SingleRequestCallerBuilder<RESP>> RawAsyncTable::CreateCallerBuilder
{noformat}
returns builder, and builder->build() returns AsyncSingleRequestRpcRetryingCaller<RESP>,
then AsyncSingleRequestRpcRetryingCaller<RESP>.call() returns RESP which is the hbase::Result.
{noformat}
# you may need to do cast like this, std::shared_ptr itself is agnostic of polymorphism of
the enclosed type.
115	std::shared_ptr<RpcChannel> RpcClient::CreateRpcChannel(const std::string &host,
116	    uint16_t port, std::shared_ptr<User> ticket, int rpc_timeout) {
117	
118	  std::shared_ptr<RpcChannelImplementation> channel = std::make_shared<
119	      RpcChannelImplementation>(shared_from_this(), host, port, ticket,
120	      rpc_timeout);
121	
122	  /* static_pointer_cast is safe since RpcChannelImplementation derives
123	   * from RpcChannel, otherwise, dynamic_pointer_cast should be used. */
124	  return std::static_pointer_cast<RpcChannel>(channel);
125	}

Otherwise, v2 looks fine.

> [C++] RawAsyncTable
> -------------------
>
>                 Key: HBASE-17754
>                 URL: https://issues.apache.org/jira/browse/HBASE-17754
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: hbase-17754_v0.patch, hbase-17754_v1.patch, hbase-17754-v2.patch
>
>
> We need RawAsyncTable to connect {{table.h}} to the async retrying callers. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message