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 BFB93200AE3 for ; Wed, 4 May 2016 13:10:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BE3371601A4; Wed, 4 May 2016 11:10:21 +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 B9C471601A2 for ; Wed, 4 May 2016 13:10:20 +0200 (CEST) Received: (qmail 44448 invoked by uid 500); 4 May 2016 11:10:19 -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 44437 invoked by uid 99); 4 May 2016 11:10:19 -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; Wed, 04 May 2016 11:10:19 +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 6FF73C0052 for ; Wed, 4 May 2016 11:10:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.99 X-Spam-Level: * X-Spam-Status: No, score=1.99 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, T_REMOTE_IMAGE=0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=radicalbit-io.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VUf0UzpK9Qu0 for ; Wed, 4 May 2016 11:10:17 +0000 (UTC) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 15BCE5F3F5 for ; Wed, 4 May 2016 11:10:17 +0000 (UTC) Received: by mail-yw0-f175.google.com with SMTP id o66so81493364ywc.3 for ; Wed, 04 May 2016 04:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=radicalbit-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=bYhWw4Q1QHEsrGFQ1+P3XXL4TG/cA0+LaSnYd2Yfe20=; b=RJLRXKcOaNkA2bjdO/otQR/j+rq00h/DjC4fqpWEzMQi/nutxRuJooVr196RPhh9Am JiLcWKajul7lerParPH6bsuxnpJwqWwdPo8MPNYICwXtjb7jZM/6xXXprBKSRUojcCpk fGsas4+5xCE8k5l1hP0xmZP197uMWGX7DXE4u0DDuRpfS4SP+9zNJuHfGcWn606zU+dZ QTbVM4k6ys4Y/ZnVG+zU1fNsyMCxEPH1Vtvj0bDoNd85y5oh86fVKXDHPY/eJ8YUBXgP TZzTxs8vNrgcJjNgWD6yXb5+GUoyUKPvfdPwlJSy4cU/SBX/hd5+K2EmuGJ2UNzYRYRA 0Gww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=bYhWw4Q1QHEsrGFQ1+P3XXL4TG/cA0+LaSnYd2Yfe20=; b=huarzhJj/iUlaePEqq8tK8OzMgdIL+iW10FUwtO+sYxDzpeUBLqpMUq4CMo6nhDVJd 4esENPVvBMsQlCeIItI6PoX6wjYByWXie2vlfXaoHjzu4ZMxCGO8ponHaBd9nJvene0v BNSfZBWnvi+AXpadD7tNNSEb0uzHkdBJ46D+O09PHWofhTHLIAyDJLbNv+soX9mBvQ6H 8rHlBpeRKjyQqSVMZP53H/0iKZuGGHMwfG0XeH1TzedlqkUBrfDtvleoiT4u4R18Dq69 EA1Cdz3ub2XAbvtraPPzgI0e+foYI1yOdYtz7i5m3CXVzDhrFP8gJpFOtUszTZAIB30O 2NkQ== X-Gm-Message-State: AOPr4FU7XVSVUPU+8i/XdZgJzcfdu6Yly8uoMFo7HsBQc1dKkB1rQ4TfqjUGwqWIsyepQodmthlB35zYMhbIziCK MIME-Version: 1.0 X-Received: by 10.159.39.194 with SMTP id b60mr4700488uab.151.1462360216247; Wed, 04 May 2016 04:10:16 -0700 (PDT) Received: by 10.176.6.102 with HTTP; Wed, 4 May 2016 04:10:16 -0700 (PDT) In-Reply-To: References: <1462290802815.484100202@boxbe> Date: Wed, 4 May 2016 13:10:16 +0200 Message-ID: Subject: Re: how to convert datastream to collection From: Stefano Baghino To: user@flink.apache.org Content-Type: multipart/alternative; boundary=94eb2c048150393aa705320245cc archived-at: Wed, 04 May 2016 11:10:21 -0000 --94eb2c048150393aa705320245cc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I believe you may suffer from some undefined behaviour by using different versions for Flink and contrib libraries. Please note that in your dependency declaration there's a typo: flink-streaming-contrib_${flink.version} should be flink-streaming-contrib_${scala.version}, with ${scala.version} being the one you use, either 2.10 or 2.11. On Wed, May 4, 2016 at 12:43 PM, subash basnet wrote: > Hello Stefano, > > When I did as you said, it shows: *Missing artifact > org.apache.flink:flink-streaming-contrib_1.0.0:jar:1.0.0* error. > My pom is: > > UTF-8 > 1.0.0 > > > org.apache.flink > *flink-streaming-contrib_${flink.version}* > *${flink.version}* > > > So I instead used the below for contrib dependency as given in maven > repository: > > org.apache.flink > flink-streaming-contrib > 0.10.2 > > > > Best Regards, > Subash Basnet > > On Wed, May 4, 2016 at 12:12 PM, Stefano Baghino < > stefano.baghino@radicalbit.io> wrote: > >> I think you have to explicitly import contrib packages as a dependency i= n >> Maven/SBT. >> >> In particular, in your case, it should be something like: >> >> >> org.apache.flink >> flink-streaming-contrib_${scala.version} >> ${project.version} >> >> >> for Maven. >> >> On Wed, May 4, 2016 at 12:00 PM, subash basnet >> wrote: >> >>> Hello there, >>> >>> Thank you! But I couldn't find DataStreamUtils. Where is it located? >>> I am using *1.0.0*, >>> The given, >>> org.apache.flink.*contrib*.streaming.DataStreamUtils doesn't work as >>> there is no *contrib *package within org.apache.flink. >>> >>> >>> Best Regards, >>> Subash Basnet >>> >>> On Tue, May 3, 2016 at 4:35 PM, Suneel Marthi >>> wrote: >>> >>>> [image: Boxbe] This message is >>>> eligible for Automatic Cleanup! (smarthi@apache.org) Add cleanup rule >>>> >>>> | More info >>>> >>>> >>>> DataStream> *newCentroids =3D new >>>> DataStream<>.....()* >>>> >>>> *Iterator> iter =3D >>>> DataStreamUtils.collect(newCentroids);* >>>> >>>> *List> list =3D Lists.newArrayList(iter);* >>>> >>>> On Tue, May 3, 2016 at 10:26 AM, subash basnet >>>> wrote: >>>> >>>>> Hello all, >>>>> >>>>> Suppose I have the datastream as: >>>>> DataStream> *newCentroids*; >>>>> >>>>> How to get collection of *newCentroids * to be able to loop as below: >>>>> private Collection> *centroids*; >>>>> for (Centroid cent : *centroids*) { >>>>> } >>>>> >>>>> >>>>> >>>>> Best Regards, >>>>> Subash Basnet >>>>> >>>> >>>> >>>> >>> >> >> >> -- >> BR, >> Stefano Baghino >> >> Software Engineer @ Radicalbit >> > > --=20 BR, Stefano Baghino Software Engineer @ Radicalbit --94eb2c048150393aa705320245cc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I believe you may suffer from some undefined behaviour by = using different versions for Flink and contrib libraries.
Please note t= hat in your dependency declaration there's a typo:=C2=A0flink-streaming= -contrib_${flink.version} should be=C2=A0flink-streaming-contrib_${scala.ve= rsion}, with ${scala.version} being the one you use, either 2.10 or 2.11.

On Wed,= May 4, 2016 at 12:43 PM, subash basnet <yasubash@gmail.com> wrote:
Hello Stefano,<= br>
When I did as you said,=C2=A0it shows:=C2=A0Missing artifact org.= apache.flink:flink-streaming-contrib_1.0.0:jar:1.0.0=C2=A0error.
My = pom is:
<properties>
<project.build.sourceEncoding>UTF-8</project.build= .sourceEncoding>
<flink.version>1.0.0</flink.version>
</properties= >
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-stream= ing-contrib_${flink.version}</artifactId>
<version>${flink.version}&l= t;/version>
</dependency>

So I instead used the b= elow for contrib dependency as given in maven repository:
<depen= dency>
<groupI= d>org.apache.flink</groupId>
<artifactId>flink-streaming-contrib</artifactId&= gt;
<version>0= .10.2</version>
</dependency>


Best Regards= ,
Subash Basnet

On Wed, M= ay 4, 2016 at 12:12 PM, Stefano Baghino <stefano.baghino@radic= albit.io> wrote:
I think you have to explicitly import contrib packages as a depend= ency in Maven/SBT.

In particular, in your case, it shoul= d be something like:

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flin= k-streaming-contrib_${scala.version}</artifactId>
<version>${project.version}<= /version>
</d= ependency>

for Maven.

On Wed, May 4, = 2016 at 12:00 PM, subash basnet <yasubash@gmail.com> wrote:=
Hello there,

Tha= nk you! But I couldn't find DataStreamUtils. Where is it located?
I = am using=C2=A0<flink.version>1.0.0</flink.version>,=C2= =A0
The given,=C2=A0
org.apache.flink.contrib.streaming.DataS= treamUtils doesn't work as there is no contrib package within or= g.apache.flink.=C2=A0


Best Regards,
Subash Basnet
=

On Tue, May 3, 20= 16 at 4:35 PM, Suneel Marthi <smarthi@apache.org> wrote:
3D"Boxbe" This message is eligible for Automatic Cleanup! (smarthi@apache.org)=20 Add cleanup rule | More info

DataStream<Tuple2&= lt;String,Point>>=C2=A0newCentroids =3D new DataStream<>.....= ()

Iterator<Tuple2<String, Point>> iter =3D Dat= aStreamUtils.collect(newCentroids);

List<Tuple2<>= ;> list =3D Lists.newArrayList(iter);

On Tue, May 3, 2016 a= t 10:26 AM, subash basnet <yasubash@gmail.com> wrote:
Hello all,
Suppose I have the datastream as:
DataStream<Tuple2<String,P= oint>> newCentroids;

How to get collect= ion of newCentroids =C2=A0to be able to loop as below:
=C2=A0private Collection<Tuple2<String,Point&g= t;>=C2=A0centroids;
=C2=A0for (Centroid cent :=C2=A0cen= troids) {
=C2=A0 }



Best Regards,
Subash Basnet






<= font color=3D"#888888">--
BR,
= Stefano Baghino

Software Engineer @ Radicalbit




--
=
BR,
Stef= ano Baghino

Software Engineer @ Radicalbit
--94eb2c048150393aa705320245cc--