Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Window Operations on Spark Streaming

avatar
Expert Contributor

Hi,

I was just wondering if it is ok to perform window operations on dstreams with 1 week as window length. Please let me know if there are any major concerns.

Thanks

1 ACCEPTED SOLUTION

avatar
Super Collaborator
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
4 REPLIES 4

avatar
Super Collaborator
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Expert Contributor

Thanks. If i not use Window and choose to use Streaming the data on to HDFS, could you suggest how to only store 1 week worth of data. Should i create a cron job to delete HDFS files older than a week. PLease let me know if you have any other suggestions

avatar
Super Collaborator

Hi, I'm not very sure but you could use flume to get data into HDFS by using an hdfs sink.

https://flume.apache.org/FlumeUserGuide.html

The location in hdfs is mentioned in flume-agent.conf file, for example:

agent_foo.sinks.hdfs-Cluster1-sink.hdfs.path = hdfs://namenode/flume/webdata

You could write a script to modify this directory with a timestamp and restart the flume agent. And then run that every week through cron.

avatar
Explorer

Doesn't seem like streaming data directly to HDFS will make it very easy to find/aggregate at the end of each window? What about creating a key/value store (with reddis, hbase, or elasticSearch for example) and using it to lookup all the keys associated with each window.