Class AsyncStateAppendOnlyTopNFunction

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

    public class AsyncStateAppendOnlyTopNFunction
    extends AbstractAsyncStateTopNFunction
    A TopN function could handle insert-only stream.

    The input stream should only contain INSERT messages.

    Different with AppendOnlyTopNFunction, this function is used with async state api.

    See Also:
    Serialized Form
    • Constructor Detail

      • AsyncStateAppendOnlyTopNFunction

        public AsyncStateAppendOnlyTopNFunction​(org.apache.flink.api.common.state.StateTtlConfig ttlConfig,
                                                InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType,
                                                GeneratedRecordComparator sortKeyGeneratedRecordComparator,
                                                RowDataKeySelector sortKeySelector,
                                                RankType rankType,
                                                RankRange rankRange,
                                                boolean generateUpdateBefore,
                                                boolean outputRankNumber,
                                                long cacheSize)
    • Method Detail

      • open

        public void open​(org.apache.flink.api.common.functions.OpenContext openContext)
                  throws Exception
        Specified by:
        open in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        open in class AbstractAsyncStateTopNFunction
        Throws:
        Exception
      • processElement

        public void processElement​(org.apache.flink.table.data.RowData input,
                                   org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context context,
                                   org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
                            throws Exception
        Specified by:
        processElement in class org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData>
        Throws:
        Exception