spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerard Maas <gerard.m...@gmail.com>
Subject Re: Scala Lazy values and partitions
Date Fri, 19 Dec 2014 11:52:23 GMT
It will be instantiated once per VM, which translates to once per executor.

-kr, Gerard.

On Fri, Dec 19, 2014 at 12:21 PM, Ashic Mahtab <ashic@live.com> wrote:
>
> Hi Guys,
> Are scala lazy values instantiated once per executor, or once per
> partition? For example, if I have:
>
> object Something =
>     val lazy context = create()
>
>     def foo(item) = context.doSomething(item)
>
> and I do
>
> someRdd.foreach(Something.foo)
>
> then will context get instantiated once per executor, or once per
> partition?
>
> Thanks,
> Ashic.
>
>

Mime
View raw message