@ThreadSafe protected static class AbstractAsynchronousOperationHandlers.CompletedOperationCache<K,R> extends Object
The cache allows to register ongoing operations by calling
#registerOngoingOperation(K, CompletableFuture), where the
CompletableFuture contains the operation result. Completed operations will be
removed from the cache automatically after a fixed timeout.
| Modifier | Constructor and Description |
|---|---|
protected |
CompletedOperationCache() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.types.Either<Throwable,R> |
get(K operationKey)
Returns the operation result or a
Throwable if the CompletableFuture
finished, otherwise null. |
void |
registerOngoingOperation(K operationKey,
CompletableFuture<R> operationResultFuture)
Registers an ongoing operation with the cache.
|
public void registerOngoingOperation(K operationKey, CompletableFuture<R> operationResultFuture)
operationResultFuture - A future containing the operation result.@Nullable public org.apache.flink.types.Either<Throwable,R> get(K operationKey) throws org.apache.flink.runtime.rest.handler.async.AbstractAsynchronousOperationHandlers.UnknownOperationKey
Throwable if the CompletableFuture
finished, otherwise null.UnknownOperationKey - If the operation is not found, and there is no ongoing
operation under the provided key.org.apache.flink.runtime.rest.handler.async.AbstractAsynchronousOperationHandlers.UnknownOperationKeyCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.