public class IncrementalAggregateAllTimeWindowFunction extends IncrementalAggregateAllWindowFunction<TimeWindow>
Constructor and Description |
---|
IncrementalAggregateAllTimeWindowFunction(Aggregate<?>[] aggregates,
scala.Tuple2<Object,Object>[] groupKeysMapping,
scala.Tuple2<Object,Object>[] aggregateMapping,
int finalRowArity,
scala.Option<Object> windowStartPos,
scala.Option<Object> windowEndPos) |
Modifier and Type | Method and Description |
---|---|
void |
apply(TimeWindow window,
Iterable<Row> records,
Collector<Row> out)
Calculate aggregated values output by aggregate buffer, and set them into output
Row based on the mapping relation between intermediate aggregate data and output data.
|
void |
open(Configuration parameters)
Initialization method for the function.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public IncrementalAggregateAllTimeWindowFunction(Aggregate<?>[] aggregates, scala.Tuple2<Object,Object>[] groupKeysMapping, scala.Tuple2<Object,Object>[] aggregateMapping, int finalRowArity, scala.Option<Object> windowStartPos, scala.Option<Object> windowEndPos)
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 IncrementalAggregateAllWindowFunction<TimeWindow>
parameters
- The configuration containing the parameters attached to the contract.Configuration
public void apply(TimeWindow window, Iterable<Row> records, Collector<Row> out)
IncrementalAggregateAllWindowFunction
apply
in interface AllWindowFunction<Row,Row,TimeWindow>
apply
in class IncrementalAggregateAllWindowFunction<TimeWindow>
window
- The window that is being evaluated.records
- The elements in the window being evaluated.out
- A collector for emitting elements.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.