LIVY-311. Set classpath in MiniCluster only when it is not in real cluster 
(#286)



Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/34f6c7f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/34f6c7f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/34f6c7f9

Branch: refs/heads/master
Commit: 34f6c7f9e46a656dd129057173994016b000df00
Parents: 69462b9
Author: Jeff Zhang <zjf...@gmail.com>
Authored: Thu Feb 9 01:16:56 2017 +0800
Committer: Alex Man <tc.technet...@gmail.com>
Committed: Wed Feb 8 09:16:56 2017 -0800

----------------------------------------------------------------------
 .../cloudera/livy/test/framework/MiniCluster.scala  | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/34f6c7f9/integration-test/src/main/scala/com/cloudera/livy/test/framework/MiniCluster.scala
----------------------------------------------------------------------
diff --git 
a/integration-test/src/main/scala/com/cloudera/livy/test/framework/MiniCluster.scala
 
b/integration-test/src/main/scala/com/cloudera/livy/test/framework/MiniCluster.scala
index 3cc22c2..d520269 100644
--- 
a/integration-test/src/main/scala/com/cloudera/livy/test/framework/MiniCluster.scala
+++ 
b/integration-test/src/main/scala/com/cloudera/livy/test/framework/MiniCluster.scala
@@ -238,16 +238,16 @@ class MiniCluster(config: Map[String, String]) extends 
Cluster with MiniClusterU
     assert(tempDir.mkdir(), "Cannot create temp test dir.")
     sparkConfDir = mkdir("spark-conf")
 
-    val sparkScalaVersion = getSparkScalaVersion()
-    val classPathFile =
-      new 
File(s"minicluster-dependencies/scala-$sparkScalaVersion/target/classpath")
-    assert(classPathFile.isFile,
-      s"Cannot read MiniCluster classpath file: 
${classPathFile.getCanonicalPath}")
-    val sparkClassPath =
-      FileUtils.readFileToString(classPathFile, Charset.defaultCharset())
-
     // When running a real Spark cluster, don't set the classpath.
     val extraCp = if (!isRealSpark()) {
+      val sparkScalaVersion = getSparkScalaVersion()
+      val classPathFile =
+        new 
File(s"minicluster-dependencies/scala-$sparkScalaVersion/target/classpath")
+      assert(classPathFile.isFile,
+        s"Cannot read MiniCluster classpath file: 
${classPathFile.getCanonicalPath}")
+      val sparkClassPath =
+        FileUtils.readFileToString(classPathFile, Charset.defaultCharset())
+
       val dummyJar = Files.createTempFile(Paths.get(tempDir.toURI), "dummy", 
"jar").toFile
       Map(
         SparkLauncher.DRIVER_EXTRA_CLASSPATH -> sparkClassPath,

Reply via email to