aljoscha commented on a change in pull request #13676:
URL: https://github.com/apache/flink/pull/13676#discussion_r508277562



##########
File path: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/CEP.java
##########
@@ -52,7 +52,48 @@
                        DataStream<T> input,
                        Pattern<T, ?> pattern,
                        EventComparator<T> comparator) {
-               final PatternStream<T> stream = new PatternStream<>(input, 
pattern);
-               return stream.withComparator(comparator);
+               return new PatternStream<>(input, 
pattern).withComparator(comparator);
+       }
+
+       /**
+        * Creates a {@link PatternStream} from an input data stream and a 
pattern.
+        *
+        * @param input DataStream containing the input events
+        * @param pattern Pattern specification which shall be detected
+        * @param isProcessingTime Time behaviour to specify processing time or 
event time
+        * @param <T> Type of the input events
+        * @return Resulting pattern stream
+        */
+       public static <T> PatternStream<T> pattern(
+                       DataStream<T> input,
+                       Pattern<T, ?> pattern,
+                       boolean isProcessingTime) {

Review comment:
       I still think having this as a parameter would not be very user 
friendly, seeing a call like `pattern(in, foo, false)` makes it very hard to 
know what the `false` means. If you see, however, `pattern(in, 
foo).inProcessingTime()` it's immediately obvious what's going on.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to