Code sharing between spark workers
<p>According to Spark documentation it is better to use anonymous or scala object functions in RDD transformations. I have object with next code:</p>

<pre><code>object Util {
  val someManager = new Manager()

  def process(data: String) = someManager.manage(data)
}
</code></pre>

<p>And I call it next way:</p>

<pre><code>myRDD.map(Util.process)
</code></pre>

<p>How Util object will be serialized and sent to spark workers? Does manager will be created for sending every time or only once? How much times instance of manager will be sent to spark workers?</p>