Re: JavaNetworkWordCount

2014-05-16 Thread Mayur Rustagi
It would look ugly.. as explicit datatypes need to be mentioned..
you are better off using parallelize instead.

Mayur Rustagi
Ph: +1 (760) 203 3257
http://www.sigmoidanalytics.com
@mayur_rustagi https://twitter.com/mayur_rustagi



On Fri, May 16, 2014 at 6:11 PM, Eduardo Costa Alfaia 
e.costaalf...@unibs.it wrote:

 Hi Guys,

 TD has given me this piece of code: “sparkContext.makeRDD(1 to 100,
 100).collect(), I am using a java code of NetworkWordcount, How could I
 use this piece in this code in java?

 Thanks

 Informativa sulla Privacy: http://www.unibs.it/node/8155


Print line in JavaNetworkWordCount

2014-04-02 Thread Eduardo Costa Alfaia

Hi Guys

I would like printing the content inside of line in :

JavaDStreamString lines = ssc.socketTextStream(args[1], 
Integer.parseInt(args[2]));
JavaDStreamString words = lines.flatMap(new 
FlatMapFunctionString, String() {

  @Override
  public IterableString call(String x) {
return Lists.newArrayList(x.split( ));
  }
});

Is it possible? How could I do?

Thanks

--
Informativa sulla Privacy: http://www.unibs.it/node/8155


Re: Change print() in JavaNetworkWordCount

2014-03-27 Thread Eduardo Costa Alfaia

Thank you very much  Sourav

BR

Em 3/26/14, 17:29, Sourav Chandra escreveu:

def print() {
def foreachFunc = (rdd: RDD[T], time: Time) = {
  val total = rdd.collect().toList
  println (---)
  println (Time:  + time)
  println (---)
  total.foreach(println)
//  val first11 = rdd.take(11)
//  println (---)
//  println (Time:  + time)
//  println (---)
//  first11.take(10).foreach(println)
//  if (first11.size  10) println(...)
  println()
}
new ForEachDStream(this, 
context.sparkContext.clean(foreachFunc)).register()

  }



--
Informativa sulla Privacy: http://www.unibs.it/node/8155


Change print() in JavaNetworkWordCount

2014-03-25 Thread Eduardo Costa Alfaia

Hi Guys,
I think that I already did this question, but I don't remember if anyone 
has answered me. I would like changing in the function print() the 
quantity of words and the frequency number that are sent to driver's 
screen. The default value is 10.


Anyone could help me with this?

Best Regards

--
Informativa sulla Privacy: http://www.unibs.it/node/8155


Re: Change print() in JavaNetworkWordCount

2014-03-25 Thread Sourav Chandra
You can extend DStream and override print() method. Then you can create
your own DSTream extending from this.


On Tue, Mar 25, 2014 at 6:07 PM, Eduardo Costa Alfaia 
e.costaalf...@unibs.it wrote:

 Hi Guys,
 I think that I already did this question, but I don't remember if anyone
 has answered me. I would like changing in the function print() the quantity
 of words and the frequency number that are sent to driver's screen. The
 default value is 10.

 Anyone could help me with this?

 Best Regards

 --
 Informativa sulla Privacy: http://www.unibs.it/node/8155




-- 

Sourav Chandra

Senior Software Engineer

· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·

sourav.chan...@livestream.com

o: +91 80 4121 8723

m: +91 988 699 3746

skype: sourav.chandra

Livestream

Ajmera Summit, First Floor, #3/D, 68 Ward, 3rd Cross, 7th C Main, 3rd
Block, Koramangala Industrial Area,

Bangalore 560034

www.livestream.com