Constructor and Description |
---|
CallableSupplier(org.apache.hadoop.fs.store.audit.AuditSpan auditSpan,
Callable<T> call)
Create.
|
CallableSupplier(Callable<T> call)
Create.
|
Modifier and Type | Method and Description |
---|---|
T |
get()
Active any span and then call the supplied callable.
|
static <T> Optional<T> |
maybeAwaitCompletion(CompletableFuture<T> future)
Block awaiting completion for any non-null future passed in;
No-op if a null arg was supplied.
|
static <T> CompletableFuture<T> |
submit(Executor executor,
org.apache.hadoop.fs.store.audit.AuditSpan auditSpan,
Callable<T> call)
Submit a callable into a completable future.
|
static <T> CompletableFuture<T> |
submit(Executor executor,
Callable<T> call)
Submit a callable into a completable future.
|
static <T> T |
waitForCompletion(CompletableFuture<T> future)
Wait for a single of future to complete, extracting IOEs afterwards.
|
static <T> void |
waitForCompletion(List<CompletableFuture<T>> futures)
Wait for a list of futures to complete.
|
static <T> Optional<T> |
waitForCompletionIgnoringExceptions(CompletableFuture<T> future)
Wait for a single of future to complete, ignoring exceptions raised.
|
public CallableSupplier(Callable<T> call)
call
- call to invoke.public T get()
public static <T> CompletableFuture<T> submit(Executor executor, Callable<T> call)
RuntimeIOException
instances.T
- typeexecutor
- executor.call
- call to invokepublic static <T> CompletableFuture<T> submit(Executor executor, org.apache.hadoop.fs.store.audit.AuditSpan auditSpan, Callable<T> call)
RuntimeIOException
instances.T
- typeexecutor
- executor.auditSpan
- audit span (or null)call
- call to invokepublic static <T> void waitForCompletion(List<CompletableFuture<T>> futures) throws IOException
T
- typefutures
- list of futures.IOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.public static <T> T waitForCompletion(CompletableFuture<T> future) throws IOException
T
- typefuture
- future to wait for.IOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.public static <T> Optional<T> waitForCompletionIgnoringExceptions(@Nullable CompletableFuture<T> future)
T
- typefuture
- future to wait for.public static <T> Optional<T> maybeAwaitCompletion(@Nullable CompletableFuture<T> future) throws IOException
T
- return typefuture
- futureIOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.