Reputation: 469
I wanted to write a spark streaming application . I have written a scala code that captured packets using java library . Now, I wanted to get these packets to a spark streaming receiver program (0.9). Should I write a new spark receiver code or is it possible to create receiver in the scala code already written to capture the packets? How can it be done? Could anyone please help me.
Upvotes: 1
Views: 634
Reputation: 1808
Have you seen the instructions for creating a custom receiver in spark.
http://spark.apache.org/docs/latest/streaming-custom-receivers.html
Its pretty easy in general. However since I am not sure how your existing packet capturing code work (does it capture in real time and dump into file, can that be changed to store in an ArrayBuffer, etc.), its hard to say how much of the code you can reuse.
Upvotes: 1