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

Xiaobing Zhou commented on HBASE-17051:
---------------------------------------

I posted v6 patch to fix this. Thanks [~enis] for reporting this. 
std::make_shared a sub class to return as base class shared_ptr is not working 
since shared_ptr is not aware of polymorphism. Instead, static or dynamic cast 
is good to use.
{code}
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     }
{code}


> [C++] implement RPC client and connection management
> ----------------------------------------------------
>
>                 Key: HBASE-17051
>                 URL: https://issues.apache.org/jira/browse/HBASE-17051
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>         Attachments: HBASE-17051-HBASE-14850.000.patch, 
> HBASE-17051-HBASE-14850.001.patch, HBASE-17051-HBASE-14850.002.patch, 
> HBASE-17051-HBASE-14850.003.patch, HBASE-17051-HBASE-14850.004.patch, 
> HBASE-17051-HBASE-14850.005.patch, HBASE-17051-HBASE-14850.006.patch
>
>
> This proposes building RPC client and connection management layer, which 
> supports the equivalent functions resides in RpcClient.java and 
> RpcConnection.java. Specifically, handler/pipeline concepts will be used for 
> implementation, similar to NettyRpcClient and NettyRpcConnection in java side.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to