Re: writing DStream RDDs to the same file

2015-03-26 Thread Akhil Das
Heres something similar which i used to do: unionDStream.foreachRDD(rdd = { val events = rdd.count() println(Received Events : + rdd.count()) if(events 0 ){ val fw = new FileWriter(events, true) fw.write(Calendar.getInstance().getTime + , + events + \n) fw.close() } }) Sending from cellphone,

writing DStream RDDs to the same file

2015-03-25 Thread Adrian Mocanu
Hi Is there a way to write all RDDs in a DStream to the same file? I tried this and got an empty file. I think it's bc the file is not closed i.e. ESMinibatchFunctions.writer.close() executes before the stream is created. Here's my code myStream.foreachRDD(rdd = { rdd.foreach(x = {