public class DataSetSlideWindowAggReduceCombineFunction extends DataSetSlideWindowAggReduceGroupFunction implements CombineFunction<Row,Row>
GroupReduceOperator
and
GroupCombineOperator
.
It is used for sliding on batch for both time and count-windows.
param: genPreAggregations Code-generated GeneratedAggregations
for partial aggregation.
param: genFinalAggregations Code-generated GeneratedAggregations
for final aggregation.
param: keysAndAggregatesArity The total arity of keys and aggregates
param: finalRowWindowStartPos relative window-start position to last field of output row
param: finalRowWindowEndPos relative window-end position to last field of output row
param: windowSize size of the window, used to determine window-end for output row
Constructor and Description |
---|
DataSetSlideWindowAggReduceCombineFunction(GeneratedAggregationsFunction genPreAggregations,
GeneratedAggregationsFunction genFinalAggregations,
int keysAndAggregatesArity,
scala.Option<Object> finalRowWindowStartPos,
scala.Option<Object> finalRowWindowEndPos,
long windowSize) |
Modifier and Type | Method and Description |
---|---|
Row |
combine(Iterable<Row> records)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
void |
open(Configuration config)
Initialization method for the function.
|
protected GeneratedAggregations |
preAggfunction() |
accumulators, function, reduce, windowStartPos
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public DataSetSlideWindowAggReduceCombineFunction(GeneratedAggregationsFunction genPreAggregations, GeneratedAggregationsFunction genFinalAggregations, int keysAndAggregatesArity, scala.Option<Object> finalRowWindowStartPos, scala.Option<Object> finalRowWindowEndPos, long windowSize)
protected GeneratedAggregations preAggfunction()
public void open(Configuration config)
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 DataSetSlideWindowAggReduceGroupFunction
config
- The configuration containing the parameters attached to the contract.Configuration
public Row combine(Iterable<Row> records)
CombineFunction
combine
in interface CombineFunction<Row,Row>
records
- The elements to be combined.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.