hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiaobing Zhou (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12909) Change ipc.Client to support asynchronous calls
Date Mon, 21 Mar 2016 18:33:25 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-12909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15204834#comment-15204834

Xiaobing Zhou commented on HADOOP-12909:

[~steve_l] why is the thread-local (i.e. asynchronousMode) not thread safe? The reason why
thread-local is chosen is to make setting asynchronousMode in a thread safe way. If you look
at HADOOP-12910 patch, e.g. FutureDistributedFileSystem#rename, 
62	      Client.setAsynchronousMode(true);
63	      dfs.getClient().rename(dfs.getPathName(absSrc), dfs.getPathName(absDst),
64	          options);
65	      return Client.getReturnValue();

After calling Client#rename, the Client#getReturnValue() is immediately called to get Future
object used to retrieve final results. FutureDistributedFileSystem#rename should be always
in the same thread with Client. There's no chance of interleaving sync and async to result
in any thread safety issues.

I agree that Client could implement AutoCloseable. Thanks.

> Change ipc.Client to support asynchronous calls
> -----------------------------------------------
>                 Key: HADOOP-12909
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12909
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: ipc
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Xiaobing Zhou
>         Attachments: HADOOP-12909-HDFS-9924.000.patch, HADOOP-12909-HDFS-9924.001.patch,
HADOOP-12909-HDFS-9924.002.patch, HADOOP-12909-HDFS-9924.003.patch
> In ipc.Client, the underlying mechanism is already supporting asynchronous calls -- the
calls shares a connection, the call requests are sent using a thread pool and the responses
can be out of order.  Indeed, synchronous call is implemented by invoking wait() in the caller
thread in order to wait for the server response.
> In this JIRA, we change ipc.Client to support asynchronous mode.  In asynchronous mode,
it return once the request has been sent out but not wait for the response from the server.

This message was sent by Atlassian JIRA

View raw message