use of org.apache.flink.streaming.api.SimpleTimerService in project flink by apache.
the class LegacyKeyedCoProcessOperator method open.
@Override
public void open() throws Exception {
super.open();
collector = new TimestampedCollector<>(output);
InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this);
TimerService timerService = new SimpleTimerService(internalTimerService);
context = new ContextImpl<>(userFunction, timerService);
onTimerContext = new OnTimerContextImpl<>(userFunction, timerService);
}
use of org.apache.flink.streaming.api.SimpleTimerService in project flink by apache.
the class AbstractStreamArrowPythonOverWindowAggregateFunctionOperator method open.
@Override
public void open() throws Exception {
super.open();
InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("python-over-window-timers", VoidNamespaceSerializer.INSTANCE, this);
timerService = new SimpleTimerService(internalTimerService);
InternalTypeInfo<RowData> inputTypeInfo = InternalTypeInfo.of(inputType);
ListTypeInfo<RowData> rowListTypeInfo = new ListTypeInfo<>(inputTypeInfo);
MapStateDescriptor<Long, List<RowData>> inputStateDesc = new MapStateDescriptor<>("inputState", Types.LONG, rowListTypeInfo);
ValueStateDescriptor<Long> lastTriggeringTsDescriptor = new ValueStateDescriptor<>("lastTriggeringTsState", Types.LONG);
lastTriggeringTsState = getRuntimeContext().getState(lastTriggeringTsDescriptor);
ValueStateDescriptor<Long> cleanupTsStateDescriptor = new ValueStateDescriptor<>("cleanupTsState", Types.LONG);
cleanupTsState = getRuntimeContext().getState(cleanupTsStateDescriptor);
inputState = getRuntimeContext().getMapState(inputStateDesc);
}
use of org.apache.flink.streaming.api.SimpleTimerService in project flink by apache.
the class CoBroadcastWithKeyedOperator method open.
@Override
public void open() throws Exception {
super.open();
InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this);
TimerService timerService = new SimpleTimerService(internalTimerService);
collector = new TimestampedCollector<>(output);
this.broadcastStates = new HashMap<>(broadcastStateDescriptors.size());
for (MapStateDescriptor<?, ?> descriptor : broadcastStateDescriptors) {
broadcastStates.put(descriptor, getOperatorStateBackend().getBroadcastState(descriptor));
}
rwContext = new ReadWriteContextImpl(getExecutionConfig(), getKeyedStateBackend(), userFunction, broadcastStates, timerService);
rContext = new ReadOnlyContextImpl(getExecutionConfig(), userFunction, broadcastStates, timerService);
onTimerContext = new OnTimerContextImpl(getExecutionConfig(), userFunction, broadcastStates, timerService);
}
use of org.apache.flink.streaming.api.SimpleTimerService in project flink by apache.
the class KeyedCoProcessOperator method open.
@Override
public void open() throws Exception {
super.open();
collector = new TimestampedCollector<>(output);
InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this);
TimerService timerService = new SimpleTimerService(internalTimerService);
context = new ContextImpl<>(userFunction, timerService);
onTimerContext = new OnTimerContextImpl<>(userFunction, timerService);
}
Aggregations