public final class FutureIO extends Object
org.apache.hadoop.util.functional.FutureIO.
These methods are used in production code.| Constructor and Description |
|---|
FutureIO() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
awaitFuture(Future<T> future,
long timeout,
TimeUnit unit)
Given a future, evaluate it.
|
static IOException |
unwrapInnerException(Throwable e)
From the inner cause of an execution exception, extract the inner cause
to an IOException, raising Errors immediately.
|
public static <T> T awaitFuture(Future<T> future, long timeout, TimeUnit unit) throws InterruptedIOException, IOException, RuntimeException, TimeoutException
Any exception generated in the future is extracted and rethrown.
T - type of the result.future - future to evaluatetimeout - timeout to waitunit - time unit.InterruptedIOException - future was interruptedIOException - if something went wrongRuntimeException - any nested RTE thrownTimeoutException - the future timed out.public static IOException unwrapInnerException(Throwable e)
UncheckedIOException: return the causee - exception.RuntimeException - if that is the inner cause.Error - if that is the inner cause.Copyright © 2023 The Apache Software Foundation. All rights reserved.