org.apache.flink.streaming.api.operators.TimerSerializer Java Examples

The following examples show how to use org.apache.flink.streaming.api.operators.TimerSerializer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FlinkTimerServiceFactory.java    From stateful-functions with Apache License 2.0 5 votes vote down vote up
@Override
public InternalTimerService<VoidNamespace> createTimerService(
    Triggerable<String, VoidNamespace> triggerable) {
  final TimerSerializer<String, VoidNamespace> timerSerializer =
      new TimerSerializer<>(StringSerializer.INSTANCE, VoidNamespaceSerializer.INSTANCE);

  return timeServiceManager.getInternalTimerService(
      DELAYED_MSG_TIMER_SERVICE_NAME, timerSerializer, triggerable);
}
 
Example #2
Source File: FlinkTimerServiceFactory.java    From flink-statefun with Apache License 2.0 5 votes vote down vote up
@Override
public InternalTimerService<VoidNamespace> createTimerService(
    Triggerable<String, VoidNamespace> triggerable) {
  final TimerSerializer<String, VoidNamespace> timerSerializer =
      new TimerSerializer<>(StringSerializer.INSTANCE, VoidNamespaceSerializer.INSTANCE);

  return timeServiceManager.getInternalTimerService(
      DELAYED_MSG_TIMER_SERVICE_NAME, timerSerializer, triggerable);
}
 
Example #3
Source File: KeyedStateInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private InternalTimerService<VoidNamespace> restoreTimerService(StreamOperatorStateContext context) {
	InternalTimeServiceManager<K> timeServiceManager = (InternalTimeServiceManager<K>) context.internalTimerServiceManager();
	TimerSerializer<K, VoidNamespace> timerSerializer = new TimerSerializer<>(keySerializer, VoidNamespaceSerializer.INSTANCE);
	return timeServiceManager.getInternalTimerService(USER_TIMERS_NAME, timerSerializer, VoidTriggerable.instance());
}
 
Example #4
Source File: StateReaderOperator.java    From flink with Apache License 2.0 4 votes vote down vote up
protected final InternalTimerService<N> getInternalTimerService(String name) {
	TimerSerializer<KEY, N> timerSerializer = new TimerSerializer<>(keySerializer, namespaceSerializer);
	return timerServiceManager.getInternalTimerService(name, timerSerializer, VoidTriggerable.instance());
}