Class NonKeyedPartitionWindowedStream<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.datastream.NonKeyedPartitionWindowedStream<T>
-
- All Implemented Interfaces:
PartitionWindowedStream<T>
@Internal public class NonKeyedPartitionWindowedStream<T> extends Object implements PartitionWindowedStream<T>
NonKeyedPartitionWindowedStream
represents a data stream that collects all records of each subtask separately into a full window.
-
-
Constructor Summary
Constructors Constructor Description NonKeyedPartitionWindowedStream(StreamExecutionEnvironment environment, DataStream<T> input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <ACC,R>
SingleOutputStreamOperator<R>aggregate(AggregateFunction<T,ACC,R> aggregateFunction)
Applies an aggregate transformation on the records of the window.<R> SingleOutputStreamOperator<R>
mapPartition(MapPartitionFunction<T,R> mapPartitionFunction)
Process the records of the window byMapPartitionFunction
.SingleOutputStreamOperator<T>
reduce(ReduceFunction<T> reduceFunction)
Applies a reduce transformation on the records of the window.SingleOutputStreamOperator<T>
sortPartition(int field, Order order)
Sorts the records of the window on the specified field in the specified order.SingleOutputStreamOperator<T>
sortPartition(String field, Order order)
Sorts the records of the window on the specified field in the specified order.<K> SingleOutputStreamOperator<T>
sortPartition(KeySelector<T,K> keySelector, Order order)
Sorts the records according to aKeySelector
in the specified order.
-
-
-
Constructor Detail
-
NonKeyedPartitionWindowedStream
public NonKeyedPartitionWindowedStream(StreamExecutionEnvironment environment, DataStream<T> input)
-
-
Method Detail
-
mapPartition
public <R> SingleOutputStreamOperator<R> mapPartition(MapPartitionFunction<T,R> mapPartitionFunction)
Description copied from interface:PartitionWindowedStream
Process the records of the window byMapPartitionFunction
.- Specified by:
mapPartition
in interfacePartitionWindowedStream<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(ReduceFunction<T> reduceFunction)
Description copied from interface:PartitionWindowedStream
Applies a reduce transformation on the records of the window.- Specified by:
reduce
in interfacePartitionWindowedStream<T>
- Parameters:
reduceFunction
- The reduce function.- Returns:
- The data stream with final reduced result.
-
aggregate
public <ACC,R> SingleOutputStreamOperator<R> aggregate(AggregateFunction<T,ACC,R> aggregateFunction)
Description copied from interface:PartitionWindowedStream
Applies an aggregate transformation on the records of the window.- Specified by:
aggregate
in interfacePartitionWindowedStream<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, 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 beTuple
.This operator will use managed memory for the sort.For
NonKeyedPartitionWindowedStream
, the managed memory size can be set byExecutionOptions.SORT_PARTITION_MEMORY
. ForKeyedPartitionWindowedStream
, the managed memory size can be set byExecutionOptions.SORT_KEYED_PARTITION_MEMORY
.- Specified by:
sortPartition
in interfacePartitionWindowedStream<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, 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 POJOPojoTypeInfo
. 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 byExecutionOptions.SORT_PARTITION_MEMORY
. ForKeyedPartitionWindowedStream
, the managed memory size can be set byExecutionOptions.SORT_KEYED_PARTITION_MEMORY
.- Specified by:
sortPartition
in interfacePartitionWindowedStream<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(KeySelector<T,K> keySelector, Order order)
Description copied from interface:PartitionWindowedStream
Sorts the records according to aKeySelector
in the specified order.This operator will use managed memory for the sort.For
NonKeyedPartitionWindowedStream
, the managed memory size can be set byExecutionOptions.SORT_PARTITION_MEMORY
. ForKeyedPartitionWindowedStream
, the managed memory size can be set byExecutionOptions.SORT_KEYED_PARTITION_MEMORY
.- Specified by:
sortPartition
in interfacePartitionWindowedStream<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.
-
-