cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu Lin (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-8565) opinion on refactoring ListenableFuture to Java 8 CompletableFuture
Date Mon, 05 Jan 2015 20:28:34 GMT
Yu Lin created CASSANDRA-8565:

             Summary: opinion on refactoring ListenableFuture to Java 8 CompletableFuture
                 Key: CASSANDRA-8565
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Yu Lin
            Priority: Minor

Hi, I'm doing research on new concurrent constructs in Java 8. I found CompletableFuture in
Java 8 has the same functionality as Guava ListenableFuture. But CompletableFuture is much
nicer because it comes together with Lambda expression in Java 8, and it is monadic, which
makes the code more readable and cleaner. Also, it provides more ways to compose different
tasks. Therefore, using CompletableFuture instead of ListenableFuture is better for future
extension and maintenance of the code.

I also created a pull request on the Github repo and refactored one ListenableFuture instance,
so you can see the diff (you don't have to apply that patch):

I'm just wondering your opinion on this kind of refactoring (or migrating the code from Java
7 to Java 8). Do you think the refactoring is useful? Do you have any plan to use Java 8?

This message was sent by Atlassian JIRA

View raw message