浏览代码

[livy] Improve error message when pyspark and py4j not found

Erick Tryzelaar 10 年之前
父节点
当前提交
d26608f4df

+ 2 - 2
apps/spark/java/livy-repl/src/main/scala/com/cloudera/hue/livy/repl/python/PythonInterpreter.scala

@@ -67,7 +67,7 @@ object PythonInterpreter extends Logging {
         val pyLibPath = Seq(sparkHome, "python", "lib").mkString(File.separator)
         val pyLibPath = Seq(sparkHome, "python", "lib").mkString(File.separator)
         val pyArchivesFile = new File(pyLibPath, "pyspark.zip")
         val pyArchivesFile = new File(pyLibPath, "pyspark.zip")
         require(pyArchivesFile.exists(),
         require(pyArchivesFile.exists(),
-          "pyspark.zip not found; cannot run pyspark application in YARN mode.")
+          "pyspark.zip not found in Spark environment; cannot run pyspark application in YARN mode.")
 
 
         val py4jFile = Files.newDirectoryStream(Paths.get(pyLibPath), "py4j-*-src.zip")
         val py4jFile = Files.newDirectoryStream(Paths.get(pyLibPath), "py4j-*-src.zip")
           .iterator()
           .iterator()
@@ -75,7 +75,7 @@ object PythonInterpreter extends Logging {
           .toFile
           .toFile
 
 
         require(py4jFile.exists(),
         require(py4jFile.exists(),
-          "py4j-0.8.2.1-src.zip not found; cannot run pyspark application in YARN mode.")
+          "py4j-*-src.zip not found in Spark environment; cannot run pyspark application in YARN mode.")
         Seq(pyArchivesFile.getAbsolutePath(), py4jFile.getAbsolutePath())
         Seq(pyArchivesFile.getAbsolutePath(), py4jFile.getAbsolutePath())
       }.getOrElse(Seq())
       }.getOrElse(Seq())
     }
     }