Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 64CF4200C62 for ; Wed, 26 Apr 2017 09:18:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 63575160BB4; Wed, 26 Apr 2017 07:18:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 26D60160B95 for ; Wed, 26 Apr 2017 09:18:52 +0200 (CEST) Received: (qmail 50337 invoked by uid 500); 26 Apr 2017 07:18:52 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 50324 invoked by uid 99); 26 Apr 2017 07:18:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2017 07:18:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E1941188C47 for ; Wed, 26 Apr 2017 07:18:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id iTUaCk1sh0KH for ; Wed, 26 Apr 2017 07:18:50 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EE72861215 for ; Wed, 26 Apr 2017 07:07:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6AA54E00B4 for ; Wed, 26 Apr 2017 07:07:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2585421DDF for ; Wed, 26 Apr 2017 07:07:04 +0000 (UTC) Date: Wed, 26 Apr 2017 07:07:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-6356) Make times() eager and enable allowing combinations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 26 Apr 2017 07:18:54 -0000 [ https://issues.apache.org/jira/browse/FLINK-6356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984278#comment-15984278 ] ASF GitHub Bot commented on FLINK-6356: --------------------------------------- Github user dawidwys commented on a diff in the pull request: https://github.com/apache/flink/pull/3761#discussion_r113377068 --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Quantifier.java --- @@ -18,51 +18,83 @@ package org.apache.flink.cep.pattern; import java.util.EnumSet; +import java.util.Objects; -public enum Quantifier { - ONE, - ZERO_OR_MORE_EAGER(QuantifierProperty.LOOPING, QuantifierProperty.EAGER), - ZERO_OR_MORE_COMBINATIONS(QuantifierProperty.LOOPING), - ZERO_OR_MORE_EAGER_STRICT(QuantifierProperty.EAGER, QuantifierProperty.STRICT, QuantifierProperty.LOOPING), - ZERO_OR_MORE_COMBINATIONS_STRICT(QuantifierProperty.STRICT, QuantifierProperty.LOOPING), - ONE_OR_MORE_EAGER( - QuantifierProperty.LOOPING, - QuantifierProperty.EAGER, - QuantifierProperty.AT_LEAST_ONE), - ONE_OR_MORE_EAGER_STRICT( - QuantifierProperty.STRICT, - QuantifierProperty.LOOPING, - QuantifierProperty.EAGER, - QuantifierProperty.AT_LEAST_ONE), - ONE_OR_MORE_COMBINATIONS(QuantifierProperty.LOOPING, QuantifierProperty.AT_LEAST_ONE), - ONE_OR_MORE_COMBINATIONS_STRICT( - QuantifierProperty.STRICT, - QuantifierProperty.LOOPING, - QuantifierProperty.AT_LEAST_ONE), - TIMES(QuantifierProperty.TIMES), - TIMES_STRICT(QuantifierProperty.TIMES, QuantifierProperty.STRICT), - OPTIONAL; +public class Quantifier { private final EnumSet properties; - Quantifier(final QuantifierProperty first, final QuantifierProperty... rest) { + private Quantifier(final QuantifierProperty first, final QuantifierProperty... rest) { this.properties = EnumSet.of(first, rest); } - Quantifier() { - this.properties = EnumSet.noneOf(QuantifierProperty.class); + public static Quantifier ONE() { + return new Quantifier(QuantifierProperty.SINGLE); + } + + public static Quantifier ONE_OR_MORE() { + return new Quantifier(QuantifierProperty.LOOPING, QuantifierProperty.EAGER); + } + + public static Quantifier TIMES() { + return new Quantifier(QuantifierProperty.TIMES, QuantifierProperty.EAGER); } public boolean hasProperty(QuantifierProperty property) { return properties.contains(property); } + public void combinations() { --- End diff -- The first `if` will be satisfied by `ONE` resulting in misleading exception. Because of that also the `else` branch of the second branch will not be reachable. > Make times() eager and enable allowing combinations. > ---------------------------------------------------- > > Key: FLINK-6356 > URL: https://issues.apache.org/jira/browse/FLINK-6356 > Project: Flink > Issue Type: Bug > Components: CEP > Affects Versions: 1.3.0 > Reporter: Kostas Kloudas > Assignee: Kostas Kloudas > Fix For: 1.3.0 > > > This is the PR that addresses it https://github.com/apache/flink/pull/3761 -- This message was sent by Atlassian JIRA (v6.3.15#6346)