[ 
https://issues.apache.org/jira/browse/HBASE-12597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jurriaan Mous updated HBASE-12597:
----------------------------------
    Attachment: HBASE-12597-v2.patch

New patch.

- Created a new RpcClientFactory which creates a RpcClient from 
"hbase.rpc.client.impl" setting or the default RpcClientImpl

- Moved all the RpcClientImpl instantiation to the new factory where possible. 
Some tests were specific to RpcClientImpl which I left as is. One test 
(TestClientTimeouts) needed a custom implementation which is loaded with the 
RpcClientFactory by a custom configuration. This enabled me to remove 
setRpcClient on HConnectionImplementation.

- Created a RpcClientAdapter (ideas are welcome for better name) which 
implements all the configuration loading and the Logger implementation. Some 
tests call that logger to enable output of debug logs and this is now enabled 
for all RpcClients that implement the adapter. All static methods and constants 
of the RpcClientImpl are also moved here. 

- Moved out all the classes that could be reused by a new RpcClient out of 
RpcClientImpl. (I use them already in my AsyncRpcClient) Those are: 
ConnectionId, FailedServerException and FailedServers.

- Assigned @InterfaceAudience.Private to RpcClient interface. (A unit test 
demanded a InterfaceAudience) I am not sure if this should be private or public 
since it can now be used for a new implementation. 

> Add RpcClient interface and enable changing of RpcClient implementation
> -----------------------------------------------------------------------
>
>                 Key: HBASE-12597
>                 URL: https://issues.apache.org/jira/browse/HBASE-12597
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>            Reporter: Jurriaan Mous
>         Attachments: HBASE-12597-v1.patch, HBASE-12597-v2.patch, 
> HBASE-12597.patch
>
>
> Currently HConnectionImplementation works with the included RpcClient which 
> is a direct implementation and not defined by an interface.
> It would be great to be able to swap out the default RpcClient with another 
> implementation which can also be controlled by the default 
> HConnectionImplementation. 
> Suggested changes:
> - Create a RpcClient interface which defines all the ways 
> HConnectionImplementation interacts with an RPC client. Like getting a 
> blocking protobuf service interface or closing the client.
> - Define which RpcClient implementation to construct by setting a 
> configuration variable which defaults to the current RpcClient.
> - Possibly create an abstract RpcClient class to only load all the basic Rpc 
> layer configurations to be used in an implementation.
> Why? It enables experimentation with RpcClients which could enable new 
> features or could be more performant than the included client. 
> I created a new RpcClient implementation based on Netty which can also be 
> called asynchronously. It would be great to also be able to use this 
> RpcClient in all the default ways and tests to see if there are any issues 
> with it. 
> https://github.com/jurmous/async-hbase-client/
> https://github.com/jurmous/async-hbase-client/blob/master/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcClient.java



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

Reply via email to