Interface KeyContextHandler
- All Known Implementing Classes:
AbstractAsyncStateStreamOperator,AbstractAsyncStateUdfStreamOperator,AbstractStreamOperator,AbstractUdfStreamOperator,AsyncEvictingWindowOperator,AsyncIntervalJoinOperator,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 KeyContextHandler
This interface is used to optimize the calls of
Input.setKeyContextElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN>), StreamOperator.setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>) and StreamOperator.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 of hasKeyContext(). 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
Modifier and TypeMethodDescriptiondefault booleanWhether theInputhas "KeyContext".default booleanWhether the first input ofStreamOperatorhas "KeyContext".default booleanWhether the second input ofStreamOperatorhas "KeyContext".
-
Method Details
-
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.
-