When a field of an object is enclosed in a closure, the object itself is also enclosed automatically, thus the object need to be serializable.

On 11/19/14 6:39 PM, Hao Ren wrote:
Hi,

When reading through ALS code, I find that:

class ALS private (
     private var numUserBlocks: Int,
     private var numProductBlocks: Int,
     private var rank: Int,
     private var iterations: Int,
     private var lambda: Double,
     private var implicitPrefs: Boolean,
     private var alpha: Double,
     private var seed: Long = System.nanoTime()
   ) extends *Serializable *with Logging

and why should ALS extend Serializable ?

if not, there will be an Exception: task is not serializable, ALS is not
serializable.
I did not find any closure functions in which ALS is referenced.

Any idea ? Thx.

Hao








--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Why-is-ALS-class-serializable-tp19262.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to