Search in sources :

Example 1 with SimpleTimerService

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

the class AbstractPythonStreamGroupAggregateOperator method open.

@Override
public void open() throws Exception {
    // The structure is:  [type]|[normal record]|[timestamp of timer]|[row key]
    // If the type is 'NORMAL_RECORD', store the RowData object in the 2nd column.
    // If the type is 'TRIGGER_TIMER', store the timestamp in 3rd column and the row key
    reuseRowData = new UpdatableRowData(GenericRowData.of(NORMAL_RECORD, null, null, null), 4);
    reuseTimerRowData = new UpdatableRowData(GenericRowData.of(TRIGGER_TIMER, null, null, null), 4);
    timerService = new SimpleTimerService(getInternalTimerService("state-clean-timer", VoidNamespaceSerializer.INSTANCE, this));
    initCleanupTimeState();
    super.open();
}
Also used : SimpleTimerService(org.apache.flink.streaming.api.SimpleTimerService) UpdatableRowData(org.apache.flink.table.data.UpdatableRowData)

Example 2 with SimpleTimerService

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

the class BaseTwoInputStreamOperatorWithStateRetention method initializeTimerService.

private void initializeTimerService() {
    InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService(TIMERS_STATE_NAME, VoidNamespaceSerializer.INSTANCE, this);
    timerService = new SimpleTimerService(internalTimerService);
}
Also used : SimpleTimerService(org.apache.flink.streaming.api.SimpleTimerService) VoidNamespace(org.apache.flink.runtime.state.VoidNamespace)

Example 3 with SimpleTimerService

use of org.apache.flink.streaming.api.SimpleTimerService 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 4 with SimpleTimerService

use of org.apache.flink.streaming.api.SimpleTimerService 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 5 with SimpleTimerService

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

the class BaseTemporalSortOperator method open.

@Override
public void open() throws Exception {
    InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers", VoidNamespaceSerializer.INSTANCE, this);
    timerService = new SimpleTimerService(internalTimerService);
    collector = new TimestampedCollector<>(output);
}
Also used : SimpleTimerService(org.apache.flink.streaming.api.SimpleTimerService) VoidNamespace(org.apache.flink.runtime.state.VoidNamespace)

Aggregations

SimpleTimerService (org.apache.flink.streaming.api.SimpleTimerService)9 VoidNamespace (org.apache.flink.runtime.state.VoidNamespace)8 TimerService (org.apache.flink.streaming.api.TimerService)5 InternalTimerService (org.apache.flink.streaming.api.operators.InternalTimerService)3 List (java.util.List)1 MapStateDescriptor (org.apache.flink.api.common.state.MapStateDescriptor)1 ValueStateDescriptor (org.apache.flink.api.common.state.ValueStateDescriptor)1 ListTypeInfo (org.apache.flink.api.java.typeutils.ListTypeInfo)1 RowData (org.apache.flink.table.data.RowData)1 UpdatableRowData (org.apache.flink.table.data.UpdatableRowData)1