Search in sources :

Example 1 with TimerService

use of org.apache.flink.streaming.api.TimerService in project flink by apache.

the class KeyedProcessOperator 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)

Example 2 with TimerService

use of org.apache.flink.streaming.api.TimerService in project flink by apache.

the class LegacyKeyedProcessOperator 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)

Example 3 with TimerService

use of org.apache.flink.streaming.api.TimerService 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);
}
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)

Example 4 with TimerService

use of org.apache.flink.streaming.api.TimerService in project flink by apache.

the class KeyedStateBootstrapOperator method open.

@Override
public void open() throws Exception {
    super.open();
    Supplier<InternalTimerService<VoidNamespace>> internalTimerService = () -> getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, VoidTriggerable.instance());
    TimerService timerService = new LazyTimerService(internalTimerService, getProcessingTimeService());
    context = new KeyedStateBootstrapOperator<K, IN>.ContextImpl(userFunction, timerService);
}
Also used : InternalTimerService(org.apache.flink.streaming.api.operators.InternalTimerService) TimerService(org.apache.flink.streaming.api.TimerService) InternalTimerService(org.apache.flink.streaming.api.operators.InternalTimerService)

Example 5 with TimerService

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

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