Class ContextAsyncFutureImpl<T>
- java.lang.Object
-
- org.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>
-
- org.apache.flink.runtime.asyncprocessing.ContextAsyncFutureImpl<T>
-
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.StateFuture<T>,org.apache.flink.core.asyncprocessing.AsyncFuture<T>,org.apache.flink.core.asyncprocessing.InternalAsyncFuture<T>
public class ContextAsyncFutureImpl<T> extends org.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>A state future that holds theRecordContextand maintains the reference count of it. The reason why we maintain the reference here is that the ContextAsyncFutureImpl can be created multiple times since user may chain their code wildly, some of which are only for internal usage (SeeAsyncFutureImpl). So maintaining reference counting by the lifecycle of state future is relatively simple and less error-prone.Reference counting added on
RecordContextfollows:- 1. +1 when this future created.
- 2. -1 when future completed.
- 3. +1 when callback registered.
- 4. -1 when callback finished.
- Please refer to
ContextStateFutureImplTestwhere the reference counting is carefully tested.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcallbackFinished()voidcallbackRegistered()<A> org.apache.flink.core.asyncprocessing.AsyncFutureImpl<A>makeNewFuture()voidpostComplete(boolean inCallbackRunner)-
Methods inherited from class org.apache.flink.core.asyncprocessing.AsyncFutureImpl
complete, completeExceptionally, get, isDone, thenAccept, thenApply, thenCombine, thenCompose, thenConditionallyAccept, thenConditionallyAccept, thenConditionallyApply, thenConditionallyApply, thenConditionallyCompose, thenConditionallyCompose, thenSyncAccept
-
-
-
-
Method Detail
-
makeNewFuture
public <A> org.apache.flink.core.asyncprocessing.AsyncFutureImpl<A> makeNewFuture()
- Overrides:
makeNewFuturein classorg.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>
-
callbackRegistered
public void callbackRegistered()
- Overrides:
callbackRegisteredin classorg.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>
-
postComplete
public void postComplete(boolean inCallbackRunner)
- Overrides:
postCompletein classorg.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>
-
callbackFinished
public void callbackFinished()
- Overrides:
callbackFinishedin classorg.apache.flink.core.asyncprocessing.AsyncFutureImpl<T>
-
-