flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
/**
	 * Times the given future out after the timeout.
	 *
	 * @param future to time out
	 * @param timeout after which the given future is timed out
	 * @param timeUnit time unit of the timeout
	 * @param <T> type of the given future
	 * @return The timeout enriched future
	 */
Times the given future out after the timeout.
Times the given future out after the timeout .
public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) {
		final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit);
		future.whenComplete((T value, Throwable throwable) -> {
			if (!timeoutFuture.isDone()) {
				timeoutFuture.cancel(false);
			}
		});
		return future;
	}
public static < T > CompletableFuture < T > orTimeout ( CompletableFuture < T > future , long timeout , TimeUnit timeUnit ) { final ScheduledFuture < ? > timeoutFuture = Delayer . delay ( new Timeout ( future ) , timeout , timeUnit ) ; future . whenComplete ( ( T value , Throwable throwable ) -> { if ( ! timeoutFuture . isDone ( ) ) { timeoutFuture . cancel ( false ) ; } } ) ; return future ; }
Times the given future out after the timeout.
Times the given future out after the timeout .