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 D49AE200D23 for ; Thu, 19 Oct 2017 12:04:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D32511609ED; Thu, 19 Oct 2017 10:04:26 +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 24EA51609E2 for ; Thu, 19 Oct 2017 12:04:25 +0200 (CEST) Received: (qmail 92477 invoked by uid 500); 19 Oct 2017 10:04:25 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 92467 invoked by uid 99); 19 Oct 2017 10:04:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 10:04:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4798BCFFF7 for ; Thu, 19 Oct 2017 10:04:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.48 X-Spam-Level: ** X-Spam-Status: No, score=2.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=data-artisans-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id tu_M23GHx_E0 for ; Thu, 19 Oct 2017 10:04:23 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 751005FBB0 for ; Thu, 19 Oct 2017 10:04:22 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id m72so15565007wmc.0 for ; Thu, 19 Oct 2017 03:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=data-artisans-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=N1Kz3Lu4VXl/rcfdPb3isEsNDm7JnRjuwRja3O2hSrs=; b=WZqaa9hTJ+6PL7IFiGNkwQaIhqnpRPPrXKV8KYHDfKaCaGh5VrLJKqsGMpuifIeqEb LAuGz0rfrTH/lbht/WDki0pHxDwBqB/NkJfC6VcKwI478F5UiCCns0//S/OoT96ralbr 3nE3SJhYUzmY+byVJ9lJPEHh3agzZ09P9hslAstJ8YC6yRmOUiEzuf8dkafVOGgE9jxj EadLV0DbshGjkbqdRG5JPpK6avbzi7WJB+HJNqtG2835t9SN8lbLjCVbc7uzs4tJ+tZY Tbk3/Yk0g0Nu0CJ8MQeZ2x7a+EqqpW3QcYm6hz4McJCO7SSah/F9mzN3Nw/azIi6/gfy 8FMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=N1Kz3Lu4VXl/rcfdPb3isEsNDm7JnRjuwRja3O2hSrs=; b=HuRdEv412zi8gbeM58Ev+7I0JLEqdXDXDDmyqY/Ae6zKC3PJf+7QbZYufw1/UDDTUI MgaFgLvQBBFxn2iSF524kI9sF8idRq6QiOV+X+XXMD6Ymf2Fli+GrLfmCuOb0uzz1LVN W9lUVjQzNcCbun6OBHm1MUwuhpISOIOa1h1VIfoJpY/X+OgtMuHSUramBZTxQwb9+wJY kiiI8jGD+cxr6JwIjTSzN5SECnUgbb0cvBoy/ravkUt/AmPPb5fbgeB4HJr+Nh818HV2 LHij0dWX5NAMDRwolHeNX86qVSihj21E44ql21UrirRJW7VvhU1ZASKVVQu+7NfRu8kX XnVA== X-Gm-Message-State: AMCzsaV3fluAjY7AQiRJ02Unkl3wBj83JJa5PUHE9be05JLDB7aZfrHy RNpq6x22ZaGkiOhgIkhfPlKzUJpsH5E= X-Google-Smtp-Source: ABhQp+TyqFE1v6/4pcmqkjcKxyFWId9/dtQ1GRgwKxpf18BzT0EpfuywJ/7Q1ZADqbND7d+XYCRTqQ== X-Received: by 10.80.193.130 with SMTP id m2mr1743112edf.209.1508407461951; Thu, 19 Oct 2017 03:04:21 -0700 (PDT) Received: from [192.168.178.65] (ip-2-205-81-99.web.vodafone.de. [2.205.81.99]) by smtp.gmail.com with ESMTPSA id h16sm8889681edj.33.2017.10.19.03.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 03:04:21 -0700 (PDT) From: Kostas Kloudas Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_17507E84-59BB-421E-AB4A-7550E1A2023C" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: FlinkCEP: pattern application on a KeyedStream Date: Thu, 19 Oct 2017 12:04:19 +0200 In-Reply-To: Cc: user To: Federico D'Ambrosio References: X-Mailer: Apple Mail (2.3273) archived-at: Thu, 19 Oct 2017 10:04:27 -0000 --Apple-Mail=_17507E84-59BB-421E-AB4A-7550E1A2023C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Federico, If I understand your question correctly, then yes, the application of a = Pattern on a keyed stream=20 is similar to the application of a map function. It will search for the pattern on each per-key stream of data. So there will be state (buffer with partial matches, queued elements, = etc) for every active key. Cheers, Kostas > On Oct 19, 2017, at 11:55 AM, Federico D'Ambrosio = wrote: >=20 > Hi all, >=20 > I was wondering if it is correct to assume the application of a = pattern on a KeyedStream similar to the application, e.g., of a = MapFunction when it comes to state. >=20 > For example, the following >=20 > val pattern =3D ... > val keyedStream =3D stream.keyBy("id") >=20 > val patternKeyedStream =3D CEP.pattern(pattern, keyedStream) >=20 > val anotherKeyedStream =3D patternKeyedStream.select(...) >=20 > should only check the pattern on each single partition value. >=20 > Am I correct in assuming this, or I have misunderstood CEP = functioning? >=20 > --=20 > Federico D'Ambrosio --Apple-Mail=_17507E84-59BB-421E-AB4A-7550E1A2023C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi Federico,

If I understand your question correctly, then yes, the = application of a Pattern on a keyed stream 
is = similar to the application of a map function.

It will search for the pattern on each = per-key stream of data.
So there will be state = (buffer with partial matches, queued elements, etc) for every active = key.

Cheers,
Kostas

On Oct 19, 2017, at 11:55 AM, Federico D'Ambrosio <federico.dambrosio@smartlab.ws> wrote:

Hi all,

I was wondering if it is correct to assume the = application of a pattern on a KeyedStream similar to the application, = e.g., of a MapFunction when it comes to state.

For example, the = following

val pattern =3D = ...
val keyedStream =3D = stream.keyBy("id")

val = patternKeyedStream =3D CEP.pattern(pattern, keyedStream)
val anotherKeyedStream =3D = patternKeyedStream.select(...)

should only check the = pattern on each single partition value.

Am I correct in assuming this, or I = have misunderstood CEP functioning?

--
Federico = D'Ambrosio

= --Apple-Mail=_17507E84-59BB-421E-AB4A-7550E1A2023C--