Kaynağa Gözat

HUE-2853 [livy] Ignore the "spark-submit --version" exit code

"spark-submit --version" returns 1 in 1.4 and below, and 0 in 1.5,
so just ignore the value.
Erick Tryzelaar 10 yıl önce
ebeveyn
işleme
bf71176

+ 2 - 6
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/Main.scala

@@ -74,7 +74,7 @@ object Main {
       // Ignore the version for now.
       // Ignore the version for now.
       val version = sparkSubmitVersion(livyConf)
       val version = sparkSubmitVersion(livyConf)
       version match {
       version match {
-        case "1.3.0" | "1.3.1" =>
+        case "1.3.0" | "1.3.1" | "1.4.0" | "1.5.0" =>
           logger.info(f"Using spark-submit version $version")
           logger.info(f"Using spark-submit version $version")
         case _ =>
         case _ =>
           logger.warn(f"Warning, livy has not been tested with spark-submit version $version")
           logger.warn(f"Warning, livy has not been tested with spark-submit version $version")
@@ -102,15 +102,11 @@ object Main {
     val exitCode = process.waitFor()
     val exitCode = process.waitFor()
     val output = process.inputIterator.mkString("\n")
     val output = process.inputIterator.mkString("\n")
 
 
-    if (exitCode != 1) {
-      throw new IOException(f"spark-submit had an unexpected exit [$exitCode]:\n$output]")
-    }
-
     val regex = """version (.*)""".r.unanchored
     val regex = """version (.*)""".r.unanchored
 
 
     output match {
     output match {
       case regex(version) => version
       case regex(version) => version
-      case _ => throw new IOException(f"Unable to determing spark-submit version:\n$output")
+      case _ => throw new IOException(f"Unable to determing spark-submit version [$exitCode]:\n$output")
     }
     }
   }
   }
 }
 }