Sparkling shell: newly created classes are not visible by remote nodes

Description

Based on question from H2O stream (attached below) - we need to provide distributed class loading in h2o or use spark class loader to fetch newly created classes.

=================
Hi Tong,

the problem here is that remote nodes cannot see created class.
We are missing this piece in our implementation right now.

The workaround is to define and compile the class outside Spark shell and
put it on the classpath of Spark shell via `--jars` option.

Best regards,
michal

On 10/21/15 9:10 AM, Niu, Tong wrote:
>
> Hi Mike,
>
>
> I defined a class test extends MRTask, but when I use it on my H2OFrame it said NotFoundException $iwC$$iwC$test
>
>
> Following is what I wrote in sparkling-shell. How can I fix it?
>
>
> scala> class test extends MRTask[test]{
> | override def map(c: Chunk, nc: NewChunk): Unit = {
> | for (row <- 0 until c.len()) {
> | nc.addNum(c.atd(row)+1)
> | }
> | }
> | }
> defined class test
>
> scala> h20Frame.add(new test().doAll(1, h20Frame.vec(0)).outputFrame(Array("test"), null))
> java.lang.RuntimeException: javassist.NotFoundException: $iwC$$iwC$test
> at water.Weaver.genDelegate(Weaver.java:70)
> at water.TypeMap.getIcer(TypeMap.java:186)
> at water.TypeMap.getIcer(TypeMap.java:174)
> at water.H2O$H2OCountedCompleter.icer(H2O.java:1040)
> at water.H2O$H2OCountedCompleter.frozenType(H2O.java:1047)
> at water.AutoBuffer.put(AutoBuffer.java:641)
> at water.RPC.call(RPC.java:203)
> at water.MRTask.remote_compute(MRTask.java:580)
> at water.MRTask.setupLocal0(MRTask.java:533)
> at water.MRTask.asyncExec(MRTask.java:478)
> at water.MRTask.dfork(MRTask.java:458)
> at water.MRTask.doAll(MRTask.java:385)
> at water.MRTask.doAll(MRTask.java:375)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:70)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:75)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:77)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:79)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:81)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:83)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:85)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:87)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:89)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:91)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:93)
> at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:95)
> at $iwC$$iwC$$iwC$$iwC$$iwC.<init>(<console>:97)
> at $iwC$$iwC$$iwC$$iwC.<init>(<console>:99)
> at $iwC$$iwC$$iwC.<init>(<console>:101)
> at $iwC$$iwC.<init>(<console>:103)
> at $iwC.<init>(<console>:105)
> at <init>(<console>:107)
> at .<init>(<console>:111)
> at .<clinit>(<console>)
> at .<init>(<console>:7)
> at .<clinit>(<console>)
> at $print(<console>)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:1065)
> at org.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1338)
> at org.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:840)
> at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:871)
> at org.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:819)
> at org.apache.spark.repl.SparkILoop.reallyInterpret$1(SparkILoop.scala:857)
> at org.apache.spark.repl.SparkILoop.interpretStartingWith(SparkILoop.scala:902)
> at org.apache.spark.repl.SparkILoop.command(SparkILoop.scala:814)
> at org.apache.spark.repl.SparkILoop.processLine$1(SparkILoop.scala:657)
> at org.apache.spark.repl.SparkILoop.innerLoop$1(SparkILoop.scala:665)
> at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$loop(SparkILoop.scala:670)
> at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply$mcZ$sp(SparkILoop.scala:997)
> at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
> at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
> at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
> at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$process(SparkILoop.scala:945)
> at org.apache.spark.repl.SparkILoop.process(SparkILoop.scala:1059)
> at org.apache.spark.repl.Main$.main(Main.scala:31)
> at org.apache.spark.repl.Main.main(Main.scala)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:665)
> at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:170)
> at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:193)
> at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:112)
> at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
> Caused by: javassist.NotFoundException: $iwC$$iwC$test
> at javassist.ClassPool.get(ClassPool.java:450)
> at water.Weaver.javassistLoadClass(Weaver.java:124)
> at water.Weaver.genDelegate(Weaver.java:60)
>
> ... 67 more
>
>
> Thanks,
>
> Tong
>
>
>

Assignee

Unassigned

Reporter

Michal Malohlava

Labels

None

CustomerVisible

No

testcase 1

None

testcase 2

None

testcase 3

None

h2ostream link

None

Affected Spark version

None

AffectedContact

None

AffectedCustomers

None

AffectedPilots

None

AffectedOpenSource

None

Support Assessment

None

Customer Request Type

None

Support ticket URL

None

End date

None

Baseline start date

None

Baseline end date

None

Task progress

None

Task mode

None

Priority

Critical
Configure