Hi,

On Thu, Feb 26, 2015 at 11:24 AM, Thanigai Vellore <
thanigai.vell...@gmail.com> wrote:

> It appears that the function immediately returns even before the
> foreachrdd stage is executed. Is that possible?
>
Sure, that's exactly what happens. foreachRDD() schedules a computation, it
does not perform it. Maybe your streaming application would not ever
terminate, but still the function needs to return, right?

If you remove the toArray(), you will return a reference to the ArrayBuffer
that will be appended to over time. You can then, in a different thread,
check the contents of that ArrayBuffer as processing happens, or wait until
processing ends.

Tobias

Reply via email to