public class DataSetSlideTimeWindowAggReduceGroupFunction extends RichGroupReduceFunction<Row,Row> implements CombineFunction<Row,Row>, ResultTypeQueryable<Row>, Compiler<GeneratedAggregations>, Logging
This function is similar to DataSetTumbleCountWindowAggReduceGroupFunction
, however,
it does no final aggregate evaluation. It also includes the logic of
DataSetSlideTimeWindowAggFlatMapFunction
.
param: genAggregations Code-generated GeneratedAggregations
param: keysAndAggregatesArity The total arity of keys and aggregates
param: windowSize window size of the sliding window
param: windowSlide window slide of the sliding window
param: returnType return type of this function
Constructor and Description |
---|
DataSetSlideTimeWindowAggReduceGroupFunction(GeneratedAggregationsFunction genAggregations,
int keysAndAggregatesArity,
long windowSize,
long windowSlide,
TypeInformation<Row> returnType) |
Modifier and Type | Method and Description |
---|---|
Row |
combine(Iterable<Row> records)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
TypeInformation<Row> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
protected Row |
intermediateRow() |
void |
open(Configuration config)
Initialization method for the function.
|
void |
reduce(Iterable<Row> records,
Collector<Row> out)
The reduce method.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public DataSetSlideTimeWindowAggReduceGroupFunction(GeneratedAggregationsFunction genAggregations, int keysAndAggregatesArity, long windowSize, long windowSlide, TypeInformation<Row> returnType)
protected Row intermediateRow()
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 AbstractRichFunction
config
- The configuration containing the parameters attached to the contract.Configuration
public void reduce(Iterable<Row> records, Collector<Row> out)
GroupReduceFunction
reduce
in interface GroupReduceFunction<Row,Row>
reduce
in class RichGroupReduceFunction<Row,Row>
records
- All records that belong to the given input key.out
- The collector to hand results to.public Row combine(Iterable<Row> records)
CombineFunction
combine
in interface CombineFunction<Row,Row>
records
- The elements to be combined.public TypeInformation<Row> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<Row>
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.