public class RowTimeBoundedRowsOver extends ProcessFunctionWithCleanupState<CRow,CRow> implements Compiler<GeneratedAggregations>, Logging
param: genAggregations Generated aggregate helper function param: aggregationStateType row type info of aggregation param: inputRowType row type info of input row param: precedingOffset preceding offset
ProcessFunction.Context, ProcessFunction.OnTimerContext
Constructor and Description |
---|
RowTimeBoundedRowsOver(GeneratedAggregationsFunction genAggregations,
RowTypeInfo aggregationStateType,
CRowTypeInfo inputRowType,
long precedingOffset,
StreamQueryConfig queryConfig) |
Modifier and Type | Method and Description |
---|---|
void |
onTimer(long timestamp,
ProcessFunction.OnTimerContext ctx,
Collector<CRow> out)
Called when a timer set using
TimerService fires. |
void |
open(Configuration config)
Initialization method for the function.
|
void |
processElement(CRow inputC,
ProcessFunction.Context ctx,
Collector<CRow> out)
Process one element from the input stream.
|
cleanupState, initCleanupTimeState, isProcessingTimeTimer, maxRetentionTime, minRetentionTime, needToCleanupState, registerProcessingCleanupTimer, stateCleaningEnabled
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public RowTimeBoundedRowsOver(GeneratedAggregationsFunction genAggregations, RowTypeInfo aggregationStateType, CRowTypeInfo inputRowType, long precedingOffset, StreamQueryConfig queryConfig)
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 processElement(CRow inputC, ProcessFunction.Context ctx, Collector<CRow> out)
ProcessFunction
This function can output zero or more elements using the Collector
parameter
and also update internal state or set timers using the ProcessFunction.Context
parameter.
processElement
in class ProcessFunction<CRow,CRow>
inputC
- The input value.ctx
- A ProcessFunction.Context
that allows querying the timestamp of the element and getting
a TimerService
for registering timers and querying the time. The
context is only valid during the invocation of this method, do not store it.out
- The collector for returning result values.public void onTimer(long timestamp, ProcessFunction.OnTimerContext ctx, Collector<CRow> out)
ProcessFunction
TimerService
fires.onTimer
in class ProcessFunction<CRow,CRow>
timestamp
- The timestamp of the firing timer.ctx
- An ProcessFunction.OnTimerContext
that allows querying the timestamp of the firing timer,
querying the TimeDomain
of the firing timer and getting a
TimerService
for registering timers and querying the time.
The context is only valid during the invocation of this method, do not store it.out
- The collector for returning result values.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.