You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/10/19 11:03:31 UTC

[GitHub] [flink] SteNicholas commented on a change in pull request #13676: [FLINK-19326][cep] Allow explicitly configuring time behaviour on CEP PatternStream

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



##########
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:
       @aljoscha I thought that this could provide this interface to directly create PatternStream in processing time with parameter, and this is user-friendly interface. Your point that keeping the API simpler is right, but for users, IMO, it's better to specify the time behaviour by parameter, not extrally calling `inProcessingTime()` and `inEventTime()`.




----------------------------------------------------------------
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:
users@infra.apache.org