laraschmidt commented on a change in pull request #15540:
URL: https://github.com/apache/beam/pull/15540#discussion_r719816647
##########
File path:
runners/core-java/src/test/java/org/apache/beam/runners/core/SimpleDoFnRunnerTest.java
##########
@@ -472,6 +659,40 @@ public Duration getAllowedTimestampSkew() {
}
}
+ /**
+ * A {@link DoFn} that creates/sets a timer with an output timestamp equal
to the input timestamp
+ * minus the input element's value. Keys are ignored but required for timers.
+ */
+ private static class TimerSkewingDoFn extends DoFn<KV<String, Duration>,
Duration> {
+ static final String TIMER_ID = "testTimerFamily";
+ private final Duration allowedSkew;
+
+ @TimerFamily(TIMER_ID)
+ private final TimerSpec timers =
TimerSpecs.timerMap(TimeDomain.PROCESSING_TIME);
Review comment:
The elements need to share a timer then but I suppose the same logic
will hit whenever we set the output timestamp. I removed the output of elements
though since this would be harder. Wasn't really needed anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]