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

Duo Zhang commented on HADOOP-12910:
------------------------------------

Hey guys, we have posted a proposal on HDFS-916 for implementing NIO based DFS 
Output.

https://docs.google.com/document/d/11AyWtGhItQs6vsLRIx32PwTxmBY3libXwGXI25obVEY/edit#heading=h.u1kdzrdn5i99

The API we plan to add is like this
{noformat}
2.1 AsyncFileSystem
CompletableFuture<AsyncFSOutput> create(Path, …) throws IOException;

2.2 AsyncFSOutput
CompletableFuture<Void> write(byte[], int, int) throws IOException;
CompletableFuture<Long> hflush() throws IOException;
CompletableFuture<Long> hsync() throws IOException;
CompletableFuture<Long> close() throws IOException;
{noformat}

The {{CompletableFuture}} can be changed to {{Deferred}}. Callback or listener 
is very important for us. And our target is H3, for H2 we could use the current 
implementation in HBase(which uses a lot of reflections although...).

Thanks.

> Add new FileSystem API to support asynchronous method calls
> -----------------------------------------------------------
>
>                 Key: HADOOP-12910
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12910
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: fs
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Xiaobing Zhou
>         Attachments: HADOOP-12910-HDFS-9924.000.patch, 
> HADOOP-12910-HDFS-9924.001.patch, HADOOP-12910-HDFS-9924.002.patch
>
>
> Add a new API, namely FutureFileSystem (or AsynchronousFileSystem, if it is a 
> better name).  All the APIs in FutureFileSystem are the same as FileSystem 
> except that the return type is wrapped by Future, e.g.
> {code}
>   //FileSystem
>   public boolean rename(Path src, Path dst) throws IOException;
>   //FutureFileSystem
>   public Future<Boolean> rename(Path src, Path dst) throws IOException;
> {code}
> Note that FutureFileSystem does not extend FileSystem.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to