OUT - The output type of the DiscretizedStreampublic class DiscretizedStream<OUT> extends WindowedDataStream<OUT>
DiscretizedStream represents a data stream that has been divided
into windows (predefined chunks). User defined function such as
reduceWindow(ReduceFunction), mapWindow(WindowMapFunction),
or aggregations can be applied to the windows.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isPartitioned |
dataStream, discretizerKey, evictionHelper, groupByKey, isLocal, triggerHelper, userEvicter, userTrigger| Modifier | Constructor and Description |
|---|---|
protected |
DiscretizedStream(SingleOutputStreamOperator<StreamWindow<OUT>,?> discretizedStream,
org.apache.flink.api.java.functions.KeySelector<OUT,?> groupByKey,
WindowUtils.WindowTransformation tranformation,
boolean isPartitioned) |
| Modifier and Type | Method and Description |
|---|---|
protected DiscretizedStream<OUT> |
copy() |
DataStream<OUT> |
flatten()
Flattens the results of the window computations and streams out the
window elements.
|
<R> DiscretizedStream<R> |
foldWindow(R initialValue,
org.apache.flink.api.common.functions.FoldFunction<OUT,R> foldFunction,
org.apache.flink.api.common.typeinfo.TypeInformation<R> outType)
Applies a fold transformation on the windowed data stream by folding the
current window at every trigger.The user can also extend the
RichFoldFunction to gain access to other features provided by the
RichFunction interface. |
protected Class<?> |
getClassAtPos(int pos) |
DataStream<StreamWindow<OUT>> |
getDiscretizedStream()
Returns the
DataStream of StreamWindows which represent
the discretised stream. |
org.apache.flink.api.common.ExecutionConfig |
getExecutionConfig() |
String |
getName()
Gets the name of the current data stream.
|
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> |
getType()
Gets the output type.
|
WindowedDataStream<OUT> |
local()
Sets the window discretisation local, meaning that windows will be
created in parallel at environment parallelism.
|
<R> DiscretizedStream<R> |
mapWindow(WindowMapFunction<OUT,R> windowMapFunction)
Applies a mapWindow transformation on the windowed data stream by calling
the mapWindow function on the window at every trigger.
|
<R> DiscretizedStream<R> |
mapWindow(WindowMapFunction<OUT,R> windowMapFunction,
org.apache.flink.api.common.typeinfo.TypeInformation<R> returnType)
Applies a mapWindow transformation on the windowed data stream by calling
the mapWindow function on the window at every trigger.
|
DiscretizedStream<OUT> |
name(String name)
Sets the name of the current data stream.
|
DiscretizedStream<OUT> |
reduceWindow(org.apache.flink.api.common.functions.ReduceFunction<OUT> reduceFunction)
Applies a reduce transformation on the windowed data stream by reducing
the current window at every trigger.The user can also extend the
RichReduceFunction to gain access to other features provided by
the RichFunction interface. |
protected DiscretizedStream<OUT> |
timeReduce(org.apache.flink.api.common.functions.ReduceFunction<OUT> reduceFunction)
This method implements the parallel time reduce logic for time windows
|
protected DiscretizedStream(SingleOutputStreamOperator<StreamWindow<OUT>,?> discretizedStream, org.apache.flink.api.java.functions.KeySelector<OUT,?> groupByKey, WindowUtils.WindowTransformation tranformation, boolean isPartitioned)
public String getName()
public DiscretizedStream<OUT> name(String name)
public DataStream<OUT> flatten()
WindowedDataStreamflatten in class WindowedDataStream<OUT>public DataStream<StreamWindow<OUT>> getDiscretizedStream()
WindowedDataStreamDataStream of StreamWindows which represent
the discretised stream. There is no ordering guarantee for the received
windows.getDiscretizedStream in class WindowedDataStream<OUT>public DiscretizedStream<OUT> reduceWindow(org.apache.flink.api.common.functions.ReduceFunction<OUT> reduceFunction)
WindowedDataStreamRichReduceFunction to gain access to other features provided by
the RichFunction interface.reduceWindow in class WindowedDataStream<OUT>reduceFunction - The reduce function that will be applied to the windows.protected DiscretizedStream<OUT> timeReduce(org.apache.flink.api.common.functions.ReduceFunction<OUT> reduceFunction)
timeReduce in class WindowedDataStream<OUT>reduceFunction - The reduce function to be applied on the windowspublic <R> DiscretizedStream<R> mapWindow(WindowMapFunction<OUT,R> windowMapFunction)
WindowedDataStreamRichWindowMapFunction to gain access
to other features provided by the
RichFunction interface.mapWindow in class WindowedDataStream<OUT>windowMapFunction - The function that will be applied to the windows.public <R> DiscretizedStream<R> mapWindow(WindowMapFunction<OUT,R> windowMapFunction, org.apache.flink.api.common.typeinfo.TypeInformation<R> returnType)
WindowedDataStreamRichWindowMapFunction to gain access
to other features provided by the
RichFunction interface.
This version of mapWindow uses user supplied typeinformation
for serializaton. Use this only when the system is unable to detect type
information.mapWindow in class WindowedDataStream<OUT>windowMapFunction - The function that will be applied to the windows.returnType - The output type of the operator.public <R> DiscretizedStream<R> foldWindow(R initialValue, org.apache.flink.api.common.functions.FoldFunction<OUT,R> foldFunction, org.apache.flink.api.common.typeinfo.TypeInformation<R> outType)
WindowedDataStreamRichFoldFunction to gain access to other features provided by the
RichFunction interface.
This version of foldWindow uses user supplied typeinformation for
serializaton. Use this only when the system is unable to detect type
information.foldWindow in class WindowedDataStream<OUT>initialValue - Initial value given to foldFunctionfoldFunction - The fold function that will be applied to the windows.outType - The output type of the operatorprotected Class<?> getClassAtPos(int pos)
getClassAtPos in class WindowedDataStream<OUT>public org.apache.flink.api.common.ExecutionConfig getExecutionConfig()
getExecutionConfig in class WindowedDataStream<OUT>public org.apache.flink.api.common.typeinfo.TypeInformation<OUT> getType()
getType in class WindowedDataStream<OUT>protected DiscretizedStream<OUT> copy()
copy in class WindowedDataStream<OUT>public WindowedDataStream<OUT> local()
WindowedDataStreamlocal in class WindowedDataStream<OUT>Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.