Class AppendOnlyTopNFunction

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

    public class AppendOnlyTopNFunction
    extends AbstractTopNFunction
    A TopN function could handle insert-only stream.

    The input stream should only contain INSERT messages.

    See Also:
    Serialized Form
    • Constructor Detail

      • AppendOnlyTopNFunction

        public AppendOnlyTopNFunction​(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 AbstractTopNFunction
        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