Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D311818474 for ; Sat, 29 Aug 2015 01:02:50 +0000 (UTC) Received: (qmail 95125 invoked by uid 500); 29 Aug 2015 01:02:46 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 95078 invoked by uid 500); 29 Aug 2015 01:02:46 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 95061 invoked by uid 99); 29 Aug 2015 01:02:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Aug 2015 01:02:45 +0000 Date: Sat, 29 Aug 2015 01:02:45 +0000 (UTC) From: "Diogo Guerra (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8565) opinion on refactoring ListenableFuture to Java 8 CompletableFuture MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14720864#comment-14720864 ] Diogo Guerra commented on CASSANDRA-8565: ----------------------------------------- It would be interesting to revisit this suggestion > opinion on refactoring ListenableFuture to Java 8 CompletableFuture > ------------------------------------------------------------------- > > Key: CASSANDRA-8565 > URL: https://issues.apache.org/jira/browse/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): > https://github.com/apache/cassandra/pull/50 > 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 (v6.3.4#6332)