Browse Source

[livy] Allow users of repl to pass in the assembly jar

This is necessary for maven tests that put the .class files
on the classpath instead of the jar files.
Erick Tryzelaar 10 years ago
parent
commit
bebb7847a2

+ 7 - 1
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/sessions/ProcessSession.scala

@@ -10,6 +10,7 @@ import scala.concurrent.Future
 
 
 object ProcessSession extends Logging {
 object ProcessSession extends Logging {
 
 
+  val CONF_LIVY_REPL_JAR = "livy.repl.jar"
   val CONF_LIVY_REPL_CALLBACK_URL = "livy.repl.callback-url"
   val CONF_LIVY_REPL_CALLBACK_URL = "livy.repl.callback-url"
 
 
   def create(livyConf: LivyConf, id: String, lang: String): Session = {
   def create(livyConf: LivyConf, id: String, lang: String): Session = {
@@ -30,7 +31,7 @@ object ProcessSession extends Logging {
       args += javaOpts
       args += javaOpts
     }
     }
 
 
-    args += Utils.jarOfClass(getClass).head
+    args += livyJar(livyConf)
     args += lang
     args += lang
 
 
     val pb = new ProcessBuilder(args)
     val pb = new ProcessBuilder(args)
@@ -46,7 +47,12 @@ object ProcessSession extends Logging {
     pb.redirectError(Redirect.INHERIT)
     pb.redirectError(Redirect.INHERIT)
 
 
     pb.start()
     pb.start()
+  }
 
 
+  private def livyJar(conf: LivyConf): String = {
+    conf.getOption(CONF_LIVY_REPL_JAR).getOrElse {
+      Utils.jarOfClass(getClass).head
+    }
   }
   }
 }
 }