org.apache.flink.streaming.api.SimpleTimerService Java Examples

The following examples show how to use org.apache.flink.streaming.api.SimpleTimerService. 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: CoBroadcastWithKeyedOperator.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: CoBroadcastWithKeyedOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #3
Source File: CoBroadcastWithKeyedOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #4
Source File: LegacyKeyedProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #5
Source File: KeyedProcessOperator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #6
Source File: LegacyKeyedCoProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #7
Source File: KeyedCoProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #8
Source File: KeyedProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #9
Source File: BaseTwoInputStreamOperatorWithStateRetention.java    From flink with Apache License 2.0 5 votes vote down vote up
private void initializeTimerService() {
	InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService(
		TIMERS_STATE_NAME,
		VoidNamespaceSerializer.INSTANCE,
		this);

	timerService = new SimpleTimerService(internalTimerService);
}
 
Example #10
Source File: BaseTemporalSortOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void open() throws Exception {
	InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers",
			VoidNamespaceSerializer.INSTANCE,
			this);
	timerService = new SimpleTimerService(internalTimerService);
	collector = new TimestampedCollector<>(output);
}
 
Example #11
Source File: LegacyKeyedProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #12
Source File: LegacyKeyedCoProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #13
Source File: KeyedCoProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #14
Source File: KeyedProcessOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #15
Source File: KeyedStateBootstrapOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void open() throws Exception {
	super.open();

	InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService(
		"user-timers",
		VoidNamespaceSerializer.INSTANCE,
		VoidTriggerable.instance());

	TimerService timerService = new SimpleTimerService(internalTimerService);

	context = new KeyedStateBootstrapOperator<K, IN>.ContextImpl(userFunction, timerService);
}
 
Example #16
Source File: BaseTwoInputStreamOperatorWithStateRetention.java    From flink with Apache License 2.0 5 votes vote down vote up
private void initializeTimerService() {
	InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService(
		TIMERS_STATE_NAME,
		VoidNamespaceSerializer.INSTANCE,
		this);

	timerService = new SimpleTimerService(internalTimerService);
}
 
Example #17
Source File: BaseTemporalSortOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void open() throws Exception {
	InternalTimerService<VoidNamespace> internalTimerService = getInternalTimerService("user-timers",
			VoidNamespaceSerializer.INSTANCE,
			this);
	timerService = new SimpleTimerService(internalTimerService);
	collector = new TimestampedCollector<>(output);
}
 
Example #18
Source File: LegacyKeyedProcessOperator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #19
Source File: KeyedCoProcessOperator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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);
}