public class AggregateWindowFunction<W extends Window> extends RichWindowFunction<Row,Row,Tuple,W>
Constructor and Description |
---|
AggregateWindowFunction(RichGroupReduceFunction<Row,Row> groupReduceFunction) |
Modifier and Type | Method and Description |
---|---|
void |
apply(Tuple key,
W window,
Iterable<Row> input,
Collector<Row> out)
Evaluates the window and outputs none or several elements.
|
void |
open(Configuration parameters)
Initialization method for the function.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public AggregateWindowFunction(RichGroupReduceFunction<Row,Row> groupReduceFunction)
public void open(Configuration parameters)
RichFunction
The configuration object passed to the function can be used for configuration and initialization. The configuration contains all parameters that were configured on the function in the program composition.
public class MyMapper extends FilterFunction<String> {
private String searchString;
public void open(Configuration parameters) {
this.searchString = parameters.getString("foo");
}
public boolean filter(String value) {
return value.equals(searchString);
}
}
By default, this method does nothing.
open
in interface RichFunction
open
in class AbstractRichFunction
parameters
- The configuration containing the parameters attached to the contract.Configuration
public void apply(Tuple key, W window, Iterable<Row> input, Collector<Row> out)
WindowFunction
key
- The key for which this window is evaluated.window
- The window that is being evaluated.input
- The elements in the window being evaluated.out
- A collector for emitting elements.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.