Re: How to perform Broadcast and groupBy in DataStream like DataSet

2016-05-03 Thread subash basnet
Hello Stefano, Thank you, I found out that just sometime ago that I could use keyBy, but I couldn't find how to set and getBroadcastVariable in datastream like that of dataset. For example in below code we get collection of *centroids* via broadcast. Eg: In KMeans.java class X extends MapFunction

Re: How to perform Broadcast and groupBy in DataStream like DataSet

2016-05-03 Thread Stefano Baghino
I'm not sure in regards of "withBroadcastSet", but in the DataStream you "keyBy" instead of "groupBy". On Tue, May 3, 2016 at 12:35 PM, subash basnet wrote: > Hello all, > > How could we perform *withBroadcastSet* and *groupBy* in DataStream like > that of DataSet in the below KMeans code: > > D

How to perform Broadcast and groupBy in DataStream like DataSet

2016-05-03 Thread subash basnet
Hello all, How could we perform *withBroadcastSet* and *groupBy* in DataStream like that of DataSet in the below KMeans code: DataSet newCentroids = points .map(new SelectNearestCenter()).*withBroadcastSet*(loop, "centroids") .map(new CountAppender()).*groupBy*(0).reduce(new CentroidAccumulator()