flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
/**
	 * Converts a Scala {@link Future} to a {@link CompletableFuture}.
	 *
	 * @param scalaFuture to convert to a Java 8 CompletableFuture
	 * @param <T> type of the future value
	 * @return Java 8 CompletableFuture
	 */
Converts a Scala  Future to a  CompletableFuture.
@param scalaFuture to convert to a Java 8 CompletableFuture
@param  type of the future value
@return Java 8 CompletableFuture
Converts a Scala Future to a CompletableFuture . @param scalaFuture to convert to a Java 8 CompletableFuture @param type of the future value @return Java 8 CompletableFuture
public static <T> CompletableFuture<T> toJava(Future<T> scalaFuture) {
		final CompletableFuture<T> result = new CompletableFuture<>();
		scalaFuture.onComplete(new OnComplete<T>() {
			@Override
			public void onComplete(Throwable failure, T success) throws Throwable {
				if (failure != null) {
					result.completeExceptionally(failure);
				} else {
					result.complete(success);
				}
			}
		}, Executors.directExecutionContext());
		return result;
	}
public static < T > CompletableFuture < T > toJava ( Future < T > scalaFuture ) { final CompletableFuture < T > result = new CompletableFuture < > ( ) ; scalaFuture . onComplete ( new OnComplete < T > ( ) { @ Override public void onComplete ( Throwable failure , T success ) throws Throwable { if ( failure != null ) { result . completeExceptionally ( failure ) ; } else { result . complete ( success ) ; } } } , Executors . directExecutionContext ( ) ) ; return result ; }
Converts a Scala {@link Future} to a {@link CompletableFuture}.
Converts a Scala { @link Future } to a { @link CompletableFuture } .