OUT - The output type of the GroupedDataStream.public class GroupedDataStream<OUT> extends DataStream<OUT>
DataStream which has been
partitioned by the given KeySelector. Operators like reduce(org.apache.flink.api.common.functions.ReduceFunction<OUT>),
fold(R, org.apache.flink.api.common.functions.FoldFunction<OUT, R>) etc. can be applied on the GroupedDataStream to
get additional functionality by the grouping.counter, environment, id, iterationID, iterationWaitTime, parallelism, partitioner, streamGraph, typeInfo, unionizedStreams, userDefinedNames| Modifier | Constructor and Description |
|---|---|
|
GroupedDataStream(DataStream<OUT> dataStream,
org.apache.flink.api.java.functions.KeySelector<OUT,?> keySelector)
Creates a new
GroupedDataStream, group inclusion is determined using
a KeySelector on the elements of the DataStream. |
protected |
GroupedDataStream(GroupedDataStream<OUT> dataStream) |
| Modifier and Type | Method and Description |
|---|---|
protected SingleOutputStreamOperator<OUT,?> |
aggregate(AggregationFunction<OUT> aggregate) |
GroupedDataStream<OUT> |
copy()
Creates a copy of the
DataStream |
<R> SingleOutputStreamOperator<R,?> |
fold(R initialValue,
org.apache.flink.api.common.functions.FoldFunction<OUT,R> folder)
Applies a fold transformation on the grouped data stream grouped on by
the given key position.
|
org.apache.flink.api.java.functions.KeySelector<OUT,?> |
getKeySelector() |
SingleOutputStreamOperator<OUT,?> |
max(int positionToMax)
Applies an aggregation that gives the maximum of the grouped data stream
at the given position, grouped by the given key position.
|
SingleOutputStreamOperator<OUT,?> |
maxBy(int positionToMaxBy)
Applies an aggregation that that gives the current element with the
maximum value at the given position for each group on a grouped data
stream.
|
SingleOutputStreamOperator<OUT,?> |
maxBy(int positionToMaxBy,
boolean first)
Applies an aggregation that that gives the current element with the
maximum value at the given position for each group on a grouped data
stream.
|
SingleOutputStreamOperator<OUT,?> |
min(int positionToMin)
Applies an aggregation that gives the minimum of the grouped data stream
at the given position, grouped by the given key position.
|
SingleOutputStreamOperator<OUT,?> |
minBy(int positionToMinBy)
Applies an aggregation that that gives the current element with the
minimum value at the given position for each group on a grouped data
stream.
|
SingleOutputStreamOperator<OUT,?> |
minBy(int positionToMinBy,
boolean first)
Applies an aggregation that that gives the current element with the
minimum value at the given position for each group on a grouped data
stream.
|
SingleOutputStreamOperator<OUT,?> |
reduce(org.apache.flink.api.common.functions.ReduceFunction<OUT> reducer)
Applies a reduce transformation on the grouped data stream grouped on by
the given key position.
|
protected DataStream<OUT> |
setConnectionType(StreamPartitioner<OUT> partitioner)
Internal function for setting the partitioner for the DataStream
|
SingleOutputStreamOperator<OUT,?> |
sum(int positionToSum)
Applies an aggregation that sums the grouped data stream at the given
position, grouped by the given key position.
|
addSink, broadcast, checkFieldRange, clean, connect, connectGraph, count, cross, every, fillInType, filter, flatMap, forward, getClassAtPos, getExecutionConfig, getExecutionEnvironment, getId, getParallelism, getType, global, groupBy, groupBy, groupBy, iterate, iterate, join, map, max, maxBy, maxBy, min, minBy, minBy, partitionByHash, partitionByHash, partitionByHash, print, printToErr, project, rebalance, shuffle, split, sum, transform, union, window, window, write, writeAsCsv, writeAsCsv, writeAsCsv, writeAsCsv, writeAsText, writeAsText, writeAsText, writeAsText, writeToSocketpublic GroupedDataStream(DataStream<OUT> dataStream, org.apache.flink.api.java.functions.KeySelector<OUT,?> keySelector)
GroupedDataStream, group inclusion is determined using
a KeySelector on the elements of the DataStream.dataStream - Base stream of datakeySelector - Function for determining group inclusionprotected GroupedDataStream(GroupedDataStream<OUT> dataStream)
public org.apache.flink.api.java.functions.KeySelector<OUT,?> getKeySelector()
public SingleOutputStreamOperator<OUT,?> reduce(org.apache.flink.api.common.functions.ReduceFunction<OUT> reducer)
ReduceFunction will receive input
values based on the key value. Only input values with the same key will
go to the same reducer.reduce in class DataStream<OUT>reducer - The ReduceFunction that will be called for every
element of the input values with the same key.public <R> SingleOutputStreamOperator<R,?> fold(R initialValue, org.apache.flink.api.common.functions.FoldFunction<OUT,R> folder)
FoldFunction will receive input
values based on the key value. Only input values with the same key will
go to the same folder.fold in class DataStream<OUT>folder - The FoldFunction that will be called for every element
of the input values with the same key.initialValue - The initialValue passed to the folders for each key.public SingleOutputStreamOperator<OUT,?> sum(int positionToSum)
sum in class DataStream<OUT>positionToSum - The position in the data point to sumpublic SingleOutputStreamOperator<OUT,?> min(int positionToMin)
min in class DataStream<OUT>positionToMin - The position in the data point to minimizepublic SingleOutputStreamOperator<OUT,?> minBy(int positionToMinBy)
minBy in class DataStream<OUT>positionToMinBy - The position in the data point to minimizepublic SingleOutputStreamOperator<OUT,?> minBy(int positionToMinBy, boolean first)
minBy in class DataStream<OUT>positionToMinBy - The position in the data point to minimizefirst - If true, then the operator return the first element with the
maximum value, otherwise returns the lastpublic SingleOutputStreamOperator<OUT,?> max(int positionToMax)
max in class DataStream<OUT>positionToMax - The position in the data point to maximizepublic SingleOutputStreamOperator<OUT,?> maxBy(int positionToMaxBy)
maxBy in class DataStream<OUT>positionToMaxBy - The position in the data point to maximizepublic SingleOutputStreamOperator<OUT,?> maxBy(int positionToMaxBy, boolean first)
maxBy in class DataStream<OUT>positionToMaxBy - The position in the data point to maximizefirst - If true, then the operator return the first element with the
maximum value, otherwise returns the lastprotected SingleOutputStreamOperator<OUT,?> aggregate(AggregationFunction<OUT> aggregate)
aggregate in class DataStream<OUT>protected DataStream<OUT> setConnectionType(StreamPartitioner<OUT> partitioner)
DataStreamsetConnectionType in class DataStream<OUT>partitioner - Partitioner to set.public GroupedDataStream<OUT> copy()
DataStreamDataStreamcopy in class DataStream<OUT>Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.