eHarmony / aloha

A scala-based feature generation and modeling framework
http://eharmony.github.io/aloha
MIT License
60 stars 12 forks source link

Make H2O model compiler search recursively through the class loader hierarchy #213

Closed deaktator closed 6 years ago

deaktator commented 6 years ago

Currently, the compiler for H2O models finds the current class loader as:

Thread.currentThread().getContextClassLoader

and checks if it is a URLClassLoader to search for the h2o-genmodel JAR file.

For Spark REPLs (spark-shell), this is not OK because the class loader is a scala.tools.nsc.interpreter.IMain$TranslatingClassLoader, which is not a URLClassLoader, but its parent is a scala.reflect.internal.util.ScalaClassLoader$URLClassLoader which is a URLClassLoader.

Therefore, it makes sense to search the class loader hierarchy in an to attempt to find the h2o-genmodel JAR. If not done, H2O models can't be compiled in environments such as spark-shell.