spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: Persist streams to text files
Date Fri, 21 Nov 2014 05:53:37 GMT
Hi I am also having similar problem.. any fix suggested..

Originally Posted by GaganBM

I am trying to persist the DStreams to text files. When I use the inbuilt API 'saveAsTextFiles'
as :


this creates a number of subdirectories, for each batch, and within each sub directory, it
creates bunch of text files for each RDD (I assume).

I am wondering if I can have single text files for each batch. Is there any API for that ?
Or else, a single output file for the entire stream ?

I tried to manually write from each RDD stream to a text file as :

stream.foreachRDD(rdd =>{
  rdd.foreach(element => {

where 'fileWriter' simply makes use of a Java BufferedWriter to write strings to a file. However,
this fails with exception :

DStreamCheckpointData.writeObject used

Any help on how to proceed with this ?

The information contained in this electronic message and any attachments to this message are
intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email
and any attachments for the presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email.

View raw message