Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/2124#discussion_r68226912
--- Diff:
flink-streaming-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/testutils/MockRuntimeContext.java
---
@@ -186,16 +199,19 @@ public DistributedCache getDistributedCache() {
public <T> ReducingState<T> getReducingState(ReducingStateDescriptor<T>
stateProperties) {
throw new UnsupportedOperationException();
}
-
+
+ public long getCurrentProcessingTime() {
+ Preconditions.checkNotNull(timerService, "The processing time
timer has not been initialized.");
+ return timerService.getCurrentProcessingTime();
+ }
+
@Override
public ScheduledFuture<?> registerTimer(final long time, final
Triggerable target) {
- if (timer == null) {
- timer = Executors.newSingleThreadScheduledExecutor();
- }
+ Preconditions.checkNotNull(timerService, "The processing time
timer has not been initialized.");
- final long delay = Math.max(time - System.currentTimeMillis(),
0);
+ final long delay = Math.max(time -
timerService.getCurrentProcessingTime(), 0);
--- End diff --
`timerService.registerTimer()` takes an absolute timestamp not a delay now.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---