spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Sharma <>
Subject Re: Storm HDFS bolt equivalent in Spark Streaming.
Date Wed, 20 Jul 2016 04:31:56 GMT
In spark streaming , you have to decide the duration of micro batches to
Once you get the micro batch , transform it as per your logic and then you
can use saveAsTextFiles on your final RDD to write it to HDFS.


On 20 Jul 2016 9:49 am, <> wrote:

*Dell - Internal Use - Confidential *

*Dell - Internal Use - Confidential *

While writing to Kafka from Storm, the hdfs bolt provides a nice way to
batch the messages , rotate files, file name convention etc as shown below.

Do you know of something similar in Spark Streaming or do we have to roll
our own? If anyone attempted this can you throw some pointers.

Every other streaming solution like Flume and NIFI handle logic like below.

// use "|" instead of "," for field delimiter

RecordFormat format = new DelimitedRecordFormat()


// Synchronize the filesystem after every 1000 tuples

SyncPolicy syncPolicy = new CountSyncPolicy(1000);

// Rotate data files when they reach 5 MB

FileRotationPolicy rotationPolicy = new FileSizeRotationPolicy(5.0f,

// Use default, Storm-generated file names

FileNameFormat fileNameFormat = new DefaultFileNameFormat()


// Instantiate the HdfsBolt

HdfsBolt bolt = new HdfsBolt()






View raw message