Re: Immutable data

2015-09-23 Thread Jack
Thanks Aljoscha, that works! I tried passing values to base class constructor. Modifying the previous example slightly: class Base(var a: Int) class X(b: Int) extends Base(b) { this() { this(0) } } The code runs (even without Kryo) but compiler complains about b being immutable. > On 23 Sep

Re: Immutable data

2015-09-23 Thread Aljoscha Krettek
Hi Jack, Stephan is right, this should work. Unfortunately the TypeAnalyzer does not correctly detect that it cannot treat your Id class as a Pojo. I will add a Jira issue for that. For the time being you can use this command to force the system to use Kryo: env.getConfig.enableForceKryo(); I hop

Re: Immutable data

2015-09-23 Thread Jack
Hi Stephan! Here's the trace (flink 0.9.1 + scala 2.10.5) Exception in thread "main" org.apache.flink.runtime.client.JobExecutionException: Job execution failed. at org.apache.flink.runtime.jobmanager.JobManager$$anonfun$receiveWithLogMessages$1.applyOrElse(JobManager.scala:314) at scala.runti

Re: Immutable data

2015-09-23 Thread Stephan Ewen
Hi Jack! This should be supported, there is no strict requirement for mutable types. The POJO rules apply only if you want to use the "by-field-name" addressing for keys. In Scala, you should be able to use case classes as well, even if they are immutable. Can you post the exception that you get

Immutable data

2015-09-23 Thread Jack
Hi, I'm having trouble integrating existing Scala code with Flink, due to POJO-only requirement. We're using AnyVal heavily for type safety, and immutable classes as a default. For example, the following does not work: object Test { class Id(val underlying: Int) extends AnyVal class X(va