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

Tsz Wo Nicholas Sze commented on RATIS-113:
-------------------------------------------

> But I have a doubt that there might be too much context switching in this 
> case as there might be 100 threads trying to send request on the client side.

No, it is async.  A single thread could send 100 outstanding async calls.  
(Just like that a single thread could submit 100 tasks to an 
[ExecutorService|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html].)

> getCause() in RaftClientRpc#sendRequestAsync is a requirement as Hadoop Rpc 
> throws Remote exception. ...

I see.  Let's ignore Hadoop Rpc and Netty Rpc in this JIRA since, if we really 
want them to support async, we need to change them to override sendRequestAsync.

For the tests, let's create a new RaftBasicAsyncTests and add only 
TestRaftAsyncWithGrpc and TestRaftAsyncWithSimulatedRpc.


> Add Async send interface to RaftClient
> --------------------------------------
>
>                 Key: RATIS-113
>                 URL: https://issues.apache.org/jira/browse/RATIS-113
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Mukul Kumar Singh
>            Assignee: Lokesh Jain
>         Attachments: RATIS-113.001.patch, RATIS-113.002.patch, 
> RATIS-113.003.patch
>
>
> Raft Client currently only has a sync interface, an sync interface is needed 
> for ozone



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to