flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6904) Support for quantifier range to CEP's pattern API
Date Mon, 19 Jun 2017 07:16:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053545#comment-16053545
] 

ASF GitHub Bot commented on FLINK-6904:
---------------------------------------

Github user dianfu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4121#discussion_r122634439
  
    --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java
---
    @@ -318,7 +319,30 @@ public Quantifier getQuantifier() {
     		checkIfQuantifierApplied();
     		Preconditions.checkArgument(times > 0, "You should give a positive number greater
than 0.");
     		this.quantifier = Quantifier.times(quantifier.getConsumingStrategy());
    -		this.times = times;
    +		this.times = Times.of(times);
    +		return this;
    +	}
    +
    +	/**
    +	 * Specifies that the pattern can occur between from and to times.
    +	 *
    +	 * @param from number of times matching event must appear at least
    +	 * @param to number of times matching event must appear at most
    +	 * @return The same pattern with the number of times range applied
    +	 *
    +	 * @throws MalformedPatternException if the quantifier is not applicable to this pattern.
    +	 */
    +	public Pattern<T, F> times(int from, int to) {
    +		checkIfNoNotPattern();
    +		checkIfQuantifierApplied();
    +		Preconditions.checkArgument(from >= 0, "The from should be a non-negative number
greater than or equal to 0.");
    --- End diff --
    
    Make sense, removed.


> Support for quantifier range to CEP's pattern API
> -------------------------------------------------
>
>                 Key: FLINK-6904
>                 URL: https://issues.apache.org/jira/browse/FLINK-6904
>             Project: Flink
>          Issue Type: Sub-task
>          Components: CEP
>            Reporter: Dian Fu
>            Assignee: Dian Fu
>
> Currently the quantifier has supported oneOrMore, times(int times), one(),we should
also support API such as times(int from, int to) to specify a quantifier range.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message