Class KeyedPartitionWindowedStream<T,​KEY>

    • Method Detail

      • mapPartition

        public <R> SingleOutputStreamOperator<R> mapPartition​(org.apache.flink.api.common.functions.MapPartitionFunction<T,​R> mapPartitionFunction)
        Description copied from interface: PartitionWindowedStream
        Process the records of the window by MapPartitionFunction.
        Specified by:
        mapPartition in interface PartitionWindowedStream<T>
        Type Parameters:
        R - The type of map partition result.
        Parameters:
        mapPartitionFunction - The map partition function.
        Returns:
        The data stream with map partition result.
      • reduce

        public SingleOutputStreamOperator<T> reduce​(org.apache.flink.api.common.functions.ReduceFunction<T> reduceFunction)
        Description copied from interface: PartitionWindowedStream
        Applies a reduce transformation on the records of the window.
        Specified by:
        reduce in interface PartitionWindowedStream<T>
        Parameters:
        reduceFunction - The reduce function.
        Returns:
        The data stream with final reduced result.
      • aggregate

        public <ACC,​R> SingleOutputStreamOperator<R> aggregate​(org.apache.flink.api.common.functions.AggregateFunction<T,​ACC,​R> aggregateFunction)
        Description copied from interface: PartitionWindowedStream
        Applies an aggregate transformation on the records of the window.
        Specified by:
        aggregate in interface PartitionWindowedStream<T>
        Type Parameters:
        ACC - The type of accumulator in aggregate function.
        R - The type of aggregate function result.
        Parameters:
        aggregateFunction - The aggregate function.
        Returns:
        The data stream with final aggregated result.
      • sortPartition

        public SingleOutputStreamOperator<T> sortPartition​(int field,
                                                           org.apache.flink.api.common.operators.Order order)
        Description copied from interface: PartitionWindowedStream
        Sorts the records of the window on the specified field in the specified order. The type of records must be Tuple.

        This operator will use managed memory for the sort.For NonKeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_PARTITION_MEMORY. For KeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_KEYED_PARTITION_MEMORY.

        Specified by:
        sortPartition in interface PartitionWindowedStream<T>
        Parameters:
        field - The field 1-based index on which records is sorted.
        order - The order in which records is sorted.
        Returns:
        The data stream with sorted records.
      • sortPartition

        public SingleOutputStreamOperator<T> sortPartition​(String field,
                                                           org.apache.flink.api.common.operators.Order order)
        Description copied from interface: PartitionWindowedStream
        Sorts the records of the window on the specified field in the specified order. The type of records must be Flink POJO PojoTypeInfo. A type is considered a Flink POJO type, if it fulfills the conditions below.
        • It is a public class, and standalone (not a non-static inner class).
        • It has a public no-argument constructor.
        • All non-static, non-transient fields in the class (and all superclasses) are either public (and non-final) or have a public getter and a setter method that follows the Java beans naming conventions for getters and setters.
        • It is a fixed-length, null-aware composite type with non-deterministic field order. Every field can be null independent of the field's type.

        This operator will use managed memory for the sort.For NonKeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_PARTITION_MEMORY. For KeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_KEYED_PARTITION_MEMORY.

        Specified by:
        sortPartition in interface PartitionWindowedStream<T>
        Parameters:
        field - The field expression referring to the field on which records is sorted.
        order - The order in which records is sorted.
        Returns:
        The data stream with sorted records.
      • sortPartition

        public <K> SingleOutputStreamOperator<T> sortPartition​(org.apache.flink.api.java.functions.KeySelector<T,​K> keySelector,
                                                               org.apache.flink.api.common.operators.Order order)
        Description copied from interface: PartitionWindowedStream
        Sorts the records according to a KeySelector in the specified order.

        This operator will use managed memory for the sort.For NonKeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_PARTITION_MEMORY. For KeyedPartitionWindowedStream, the managed memory size can be set by ExecutionOptions.SORT_KEYED_PARTITION_MEMORY.

        Specified by:
        sortPartition in interface PartitionWindowedStream<T>
        Parameters:
        keySelector - The key selector to extract key from the records for sorting.
        order - The order in which records is sorted.
        Returns:
        The data stream with sorted records.