Class RowTimeMiniBatchLatestChangeDeduplicateFunction

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

    public class RowTimeMiniBatchLatestChangeDeduplicateFunction
    extends MapBundleFunction<K,​V,​IN,​OUT>
    This function is used to get the first or last row for every key partition in miniBatch mode. But only send latest change log to downstream.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long minRetentionTime  
      protected org.apache.flink.api.common.state.ValueState<T> state  
      protected org.apache.flink.api.common.typeinfo.TypeInformation<T> stateType  
    • Constructor Summary

      Constructors 
      Constructor Description
      RowTimeMiniBatchLatestChangeDeduplicateFunction​(InternalTypeInfo<org.apache.flink.table.data.RowData> typeInfo, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> serializer, long minRetentionTime, int rowtimeIndex, boolean generateUpdateBefore, boolean generateInsert, boolean keepLastRow)  
    • Field Detail

      • stateType

        protected final org.apache.flink.api.common.typeinfo.TypeInformation<T> stateType
      • minRetentionTime

        protected final long minRetentionTime
      • state

        protected org.apache.flink.api.common.state.ValueState<T> state
    • Constructor Detail

      • RowTimeMiniBatchLatestChangeDeduplicateFunction

        public RowTimeMiniBatchLatestChangeDeduplicateFunction​(InternalTypeInfo<org.apache.flink.table.data.RowData> typeInfo,
                                                               org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> serializer,
                                                               long minRetentionTime,
                                                               int rowtimeIndex,
                                                               boolean generateUpdateBefore,
                                                               boolean generateInsert,
                                                               boolean keepLastRow)
    • Method Detail

      • addInput

        public org.apache.flink.table.data.RowData addInput​(@Nullable
                                                            org.apache.flink.table.data.RowData value,
                                                            org.apache.flink.table.data.RowData input)
                                                     throws Exception
        Description copied from class: MapBundleFunction
        Adds the given input to the given value, returning the new bundle value.
        Specified by:
        addInput in class MapBundleFunction<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData>
        Parameters:
        value - the existing bundle value, maybe null
        input - the given input, not null
        Throws:
        Exception
      • finishBundle

        public void finishBundle​(Map<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData> buffer,
                                 org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
                          throws Exception
        Description copied from class: MapBundleFunction
        Called when a bundle is finished. Transform a bundle to zero, one, or more output elements.
        Specified by:
        finishBundle in class MapBundleFunction<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData>
        Throws:
        Exception