소스 검색

[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 11 년 전
부모
커밋
bebb7847a2
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/sessions/ProcessSession.scala

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