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

Tsz Wo Nicholas Sze commented on HADOOP-12910:
----------------------------------------------

Some other ideas:

# Use ListenableFuture. (exteneral dependency)
# Copy & paste ListenableFuture (the license may not permit)
# Copy & paste CompletionStage and CompletableFuture; see the details below.

#3 in more details: Java 8 
java.util.concurrent.CompletionStage|CompletableFuture are in [public domain 
CC0|http://creativecommons.org/publicdomain/zero/1.0/] so that we may copy them 
to org.apache.hadoop.util.concurrent.CompletionStage|CompletableFuture.  We may 
also need to copy the dependent classes. (Please correct me if I have 
misinterpreted the license.)

In branch-2, define a new class, say HadoopCompletableFuture, which implements 
Future and org.apache.hadoop.util.concurrent.CompletionStage.  The 
implementation of HadoopCompletableFuture is simply using 
org.apache.hadoop.util.concurrent.CompletableFuture.  In trunk, 
HadoopCompletableFuture in addition implements 
java.util.concurrent.CompletionStage.  Then trunk has Java 8 support and is 
backward compatible to branch-2.  In branch-2, it also has the chaining support 
although it does not have the Java 8 language feature such as lambda expression.
{code}
//branch-2
interface HadoopCompletableFuture extends Future, 
org.apache.hadoop.util.concurrent.CompletionStage {
}
{code}
{code}
//trunk
interface HadoopCompletableFuture extends Future, 
org.apache.hadoop.util.concurrent.CompletionStage, 
java.util.concurrent.CompletionStage {
}
{code}
In other words, we copy the Java 8 CompletableFuture related library to 
branch-2 since it is in public domain.  What do you think?


> 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