Interface KeyContextHandler
-
- All Known Implementing Classes:
AbstractAsyncKeyOrderedStreamOperator,AbstractAsyncRunnableStreamOperator,AbstractAsyncStateStreamOperator,AbstractAsyncStateUdfStreamOperator,AbstractStreamOperator,AbstractUdfStreamOperator,AsyncEvictingWindowOperator,AsyncIntervalJoinOperator,AsyncKeyedCoProcessOperator,AsyncKeyedCoProcessOperatorWithWatermarkDelay,AsyncKeyedProcessOperator,AsyncStreamFlatMap,AsyncWindowOperator,BatchCoBroadcastWithKeyedOperator,BatchCoBroadcastWithNonKeyedOperator,BatchGroupedReduceOperator,CacheTransformationTranslator.IdentityStreamOperator,CacheTransformationTranslator.NoOpStreamOperator,CoBroadcastWithKeyedOperator,CoBroadcastWithNonKeyedOperator,CollectSinkOperator,ContinuousFileReaderOperator,CoProcessOperator,CoStreamFlatMap,CoStreamMap,EvictingWindowOperator,GlobalCommitterOperator,IntervalJoinOperator,KeyedCoProcessOperator,KeyedProcessOperator,KeyedSortPartitionOperator,LegacyKeyedCoProcessOperator,LegacyKeyedProcessOperator,MapPartitionOperator,PartitionAggregateOperator,PartitionReduceOperator,ProcessOperator,QueryableAppendingStateOperator,QueryableValueStateOperator,SortPartitionOperator,SourceOperator,StreamFilter,StreamFlatMap,StreamGroupedReduceAsyncStateOperator,StreamGroupedReduceOperator,StreamMap,StreamProject,StreamSink,StreamSource,TimestampsAndWatermarksOperator,WindowOperator
@Internal public interface KeyContextHandlerThis interface is used to optimize the calls ofInput.setKeyContextElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN>),StreamOperator.setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>)andStreamOperator.setKeyContextElement2(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>). We can decide(at the inputs/operators initialization) whether to omit the calls of "setKeyContextElement" according to the return value ofhasKeyContext(). In this way, we can omit the calls of "setKeyContextElement" for inputs/operators that don't have "KeyContext".All inputs/operators that want to optimize the "setKeyContextElement" calls should implement this interface.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default booleanhasKeyContext()Whether theInputhas "KeyContext".default booleanhasKeyContext1()Whether the first input ofStreamOperatorhas "KeyContext".default booleanhasKeyContext2()Whether the second input ofStreamOperatorhas "KeyContext".
-
-
-
Method Detail
-
hasKeyContext
default boolean hasKeyContext()
Whether theInputhas "KeyContext". If false, we can omit the call ofInput.setKeyContextElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN>)for each record.- Returns:
- True if the
Inputhas "KeyContext", false otherwise.
-
hasKeyContext1
default boolean hasKeyContext1()
Whether the first input ofStreamOperatorhas "KeyContext". If false, we can omit the call ofStreamOperator.setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>)for each record arrived on the first input.- Returns:
- True if the first input has "KeyContext", false otherwise.
-
hasKeyContext2
default boolean hasKeyContext2()
Whether the second input ofStreamOperatorhas "KeyContext". If false, we can omit the call ofStreamOperator.setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>)for each record arrived on the second input.- Returns:
- True if the second input has "KeyContext", false otherwise.
-
-