Return-Path: X-Original-To: apmail-flink-user-archive@minotaur.apache.org Delivered-To: apmail-flink-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D68A172C4 for ; Tue, 14 Apr 2015 09:27:46 +0000 (UTC) Received: (qmail 64930 invoked by uid 500); 14 Apr 2015 09:27:46 -0000 Delivered-To: apmail-flink-user-archive@flink.apache.org Received: (qmail 64858 invoked by uid 500); 14 Apr 2015 09:27:46 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 64849 invoked by uid 99); 14 Apr 2015 09:27:46 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2015 09:27:46 +0000 Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 020931A003F for ; Tue, 14 Apr 2015 09:27:45 +0000 (UTC) Received: by wiax7 with SMTP id x7so83849028wia.0 for ; Tue, 14 Apr 2015 02:27:44 -0700 (PDT) X-Received: by 10.195.13.104 with SMTP id ex8mr36400945wjd.12.1429003664779; Tue, 14 Apr 2015 02:27:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.185.81 with HTTP; Tue, 14 Apr 2015 02:27:24 -0700 (PDT) In-Reply-To: References: From: Robert Metzger Date: Tue, 14 Apr 2015 11:27:24 +0200 Message-ID: Subject: Re: CoGgroup Operator Data Sink To: "user@flink.apache.org" Content-Type: multipart/alternative; boundary=047d7bfd0920d2701b0513abd7c5 --047d7bfd0920d2701b0513abd7c5 Content-Type: text/plain; charset=UTF-8 Hi, you can write the output of a coGroup operator to two sinks: ------\ /---->Sink1 \ / (CoGroup) / \ ------/ \------>Sink2 You can actually write to as many sinks as you want. Note that the data written to Sink1 and Sink2 will be identical. If you want to write different data to S1 and S2, you can use a Tuple2 where the first field contains a tag, and the second field contains your data. Then, you use a filter in front of your Sinks to select the data based on the tag. ------\ /---(Filter)-->Sink1 \ / (CoGroup) / \ ------/ \----(Filter)-->Sink2 So the output of CoGroup could be Tuple2, when the integer is 1, it is only written by Sink1, when the integer is 2, its only written by Sink2. On Tue, Apr 14, 2015 at 10:20 AM, Mustafa Elbehery < elbeherymustafa@gmail.com> wrote: > Hi all, > > I wonder if the coGroup operator have the ability to sink two output > simultaneously. I am trying to mock it by calling a function inside the > operator, in which I sink the first output, and get the second output > myself. > > I am not sure if this is the best way, and I would like to hear your > suggestions, > > Regards. > > -- > Mustafa Elbehery > EIT ICT Labs Master School > +49(0)15750363097 > skype: mustafaelbehery87 > > --047d7bfd0920d2701b0513abd7c5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

you can write the output of a coGro= up operator to two sinks:

------\ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /---->Sink1
=C2=A0 =C2=A0 =C2=A0 =C2=A0= \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 /
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (CoGroup)=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0/ =C2=A0 =C2=A0 = =C2=A0 =C2=A0\
------/= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\------>Sink2

You can actually write to as many sinks as you want.
Not= e that the data written to Sink1 and Sink2 will be identical.
If = you want to write different data to S1 and S2, you can use a Tuple2 where t= he first field contains a tag, and the second field contains your data.
Then, you use a filter in front of your Sinks to select the data bas= ed on the tag.

------\ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /---(Filter)-->Sink1
=C2=A0 =C2=A0 =C2=A0 =C2= =A0\ =C2=A0 =C2=A0 =C2=A0 =C2=A0 /
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (CoGroup)=C2=A0
<= font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0/ =C2=A0 =C2= =A0 =C2=A0 =C2=A0\
---= ---/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\----(Filter)-->Sink2

So the output of CoGroup could be Tuple2<Inte= ger,YourPojo>, when the integer is 1, it is only written by Sink1, when = the integer is 2, its only written by Sink2.


<= /div>


On Tue, Apr 14, 2015 at 10:20 AM, Mustafa Elbehery <elbeh= erymustafa@gmail.com> wrote:
Hi all,=C2=A0

I wonder if the coGroup= operator have the ability to sink two output simultaneously. I am trying t= o mock it by calling a function inside the operator, in which I sink the fi= rst output, and get the second output myself.=C2=A0

I am not sure if this is the best way, and I would like to hear your sugg= estions,=C2=A0

Regards.

--
Mustafa Elbehery= +49(0)15750363097
skype: mustafaelbehery87


--047d7bfd0920d2701b0513abd7c5--