Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/6096#discussion_r192994475
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/ProcessOperator.java
---
@@ -114,12 +114,22 @@ public long currentWatermark() {
@Override
public void registerProcessingTimeTimer(long time) {
- throw new UnsupportedOperationException("Setting timers
is only supported on a KeyedStream.");
+ throw new
UnsupportedOperationException(UNSUPPORTED_REGISTER_TIMER_MSG);
}
@Override
public void registerEventTimeTimer(long time) {
- throw new UnsupportedOperationException("Setting timers
is only supported on a KeyedStream.");
+ throw new
UnsupportedOperationException(UNSUPPORTED_REGISTER_TIMER_MSG);
+ }
+
+ @Override
+ public void deleteProcessingTimeTimer(long time) {
+ throw new
UnsupportedOperationException(UNSUPPORTED_DELETE_TIMER_MSG);
+ }
+
+ @Override
+ public void deleteEventTimeTimer(long time) {
+ throw new
UnsupportedOperationException(UNSUPPORTED_DELETE_TIMER_MSG);
}
--- End diff --
The reason is that `ProcessFunction` can be used both on a keyed stream and
a non-keyed stream. There is the newer `KeyedProcessFunction`, which should be
the only function that exposes timers and state but for historic reasons it's
currently like this. ð
---