flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject flink git commit: [FLINK-7325] [futures] Replace Flink's futures by Java 8's CompletableFuture in MiniCluster
Date Wed, 02 Aug 2017 08:02:55 GMT
Repository: flink
Updated Branches:
  refs/heads/master c4b84ccb3 -> 7215f9d3e


[FLINK-7325] [futures] Replace Flink's futures by Java 8's CompletableFuture in MiniCluster

This closes #4439.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/7215f9d3
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/7215f9d3
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/7215f9d3

Branch: refs/heads/master
Commit: 7215f9d3eca9da7938f029995d71d4fd0d575724
Parents: c4b84cc
Author: Till Rohrmann <trohrmann@apache.org>
Authored: Mon Jul 31 19:55:50 2017 +0200
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Wed Aug 2 10:00:18 2017 +0200

----------------------------------------------------------------------
 .../org/apache/flink/runtime/minicluster/MiniCluster.java   | 4 ++--
 .../runtime/minicluster/OneTimeLeaderListenerFuture.java    | 9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/7215f9d3/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
index 0fa8f8b..2e36e9e 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
@@ -29,7 +29,6 @@ import org.apache.flink.runtime.blob.BlobServer;
 import org.apache.flink.runtime.client.JobExecutionException;
 import org.apache.flink.runtime.clusterframework.FlinkResourceManager;
 import org.apache.flink.runtime.clusterframework.types.ResourceID;
-import org.apache.flink.runtime.concurrent.Future;
 import org.apache.flink.runtime.heartbeat.HeartbeatServices;
 import org.apache.flink.runtime.highavailability.HighAvailabilityServices;
 import org.apache.flink.runtime.highavailability.HighAvailabilityServicesUtils;
@@ -53,6 +52,7 @@ import org.slf4j.LoggerFactory;
 import javax.annotation.concurrent.GuardedBy;
 
 import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
 
 import static org.apache.flink.util.ExceptionUtils.firstOrSuppressed;
 import static org.apache.flink.util.Preconditions.checkNotNull;
@@ -404,7 +404,7 @@ public class MiniCluster {
 
 	public void waitUntilTaskManagerRegistrationsComplete() throws Exception {
 		LeaderRetrievalService rmMasterListener = null;
-		Future<LeaderAddressAndId> addressAndIdFuture;
+		CompletableFuture<LeaderAddressAndId> addressAndIdFuture;
 
 		try {
 			synchronized (lock) {

http://git-wip-us.apache.org/repos/asf/flink/blob/7215f9d3/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/OneTimeLeaderListenerFuture.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/OneTimeLeaderListenerFuture.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/OneTimeLeaderListenerFuture.java
index b0157d8..77b9847 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/OneTimeLeaderListenerFuture.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/OneTimeLeaderListenerFuture.java
@@ -18,12 +18,11 @@
 
 package org.apache.flink.runtime.minicluster;
 
-import org.apache.flink.runtime.concurrent.impl.FlinkCompletableFuture;
-import org.apache.flink.runtime.concurrent.impl.FlinkFuture;
 import org.apache.flink.runtime.leaderelection.LeaderAddressAndId;
 import org.apache.flink.runtime.leaderretrieval.LeaderRetrievalListener;
 
 import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
 
 /**
  * A leader listener that exposes a future for the first leader notification.  
@@ -32,17 +31,17 @@ import java.util.UUID;
  */
 public class OneTimeLeaderListenerFuture implements LeaderRetrievalListener {
 
-	private final FlinkCompletableFuture<LeaderAddressAndId> future;
+	private final CompletableFuture<LeaderAddressAndId> future;
 
 	public OneTimeLeaderListenerFuture() {
-		this.future = new FlinkCompletableFuture<>();
+		this.future = new CompletableFuture<>();
 	}
 
 	/**
 	 * Gets the future that is completed with the leader address and ID. 
 	 * @return The future.
 	 */
-	public FlinkFuture<LeaderAddressAndId> future() {
+	public CompletableFuture<LeaderAddressAndId> future() {
 		return future;
 	}
 


Mime
View raw message