How can I receive messages as RDD instead of DStream from a realtime source with a custom receiver?

50 Views Asked by At

I want to get RDD from a realtime message source (currently socket) to replace the line of code that is used to read from a local file sc.newAPIHadoopFile(). In order to maintain the structure of the project, I have to get RDD instead of DStream from that source. I tried to implement a custom receiver, but StreamingContext.receiverStream() only gives me a DStream. How can I do?

I tried to convert a DStream to RDD with compute, but that doesn’t make any sense and I failed. So I turned to discover how to directly receive RDD with a receiver.

0

There are 0 best solutions below