Search in sources :

Example 6 with TimerService

use of org.apache.flink.streaming.api.TimerService 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);
}
Also used : SimpleTimerService(org.apache.flink.streaming.api.SimpleTimerService) VoidNamespace(org.apache.flink.runtime.state.VoidNamespace) TimerService(org.apache.flink.streaming.api.TimerService) SimpleTimerService(org.apache.flink.streaming.api.SimpleTimerService) InternalTimerService(org.apache.flink.streaming.api.operators.InternalTimerService)

Aggregations

TimerService (org.apache.flink.streaming.api.TimerService)6 VoidNamespace (org.apache.flink.runtime.state.VoidNamespace)5 SimpleTimerService (org.apache.flink.streaming.api.SimpleTimerService)5 InternalTimerService (org.apache.flink.streaming.api.operators.InternalTimerService)4