zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject zeppelin git commit: [HOTFIX] HotFix for FlinkIntegrationTest fail
Date Mon, 20 Aug 2018 08:08:34 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 6fac6cd15 -> 0288e4006


[HOTFIX] HotFix for FlinkIntegrationTest fail

(cherry picked from commit f72c19e9475983d2f0d2c079e765c5243a7d65cc)


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/0288e400
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/0288e400
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/0288e400

Branch: refs/heads/master
Commit: 0288e40061d3c24337c394f4e0cd9e3f98847a44
Parents: 6fac6cd
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Mon Aug 20 15:17:52 2018 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Mon Aug 20 16:08:23 2018 +0800

----------------------------------------------------------------------
 .../interpreter/SparkDownloadUtils.java         | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0288e400/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/SparkDownloadUtils.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/SparkDownloadUtils.java
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/SparkDownloadUtils.java
index 157b989..9bef4d9 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/SparkDownloadUtils.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/SparkDownloadUtils.java
@@ -52,7 +52,6 @@ public class SparkDownloadUtils {
       }
     }
     // fallback to use apache archive
-    // https://archive.apache.org/dist/spark/spark-1.6.3/spark-1.6.3-bin-hadoop2.6.tgz
     if (!downloaded) {
       File downloadFile = new File(downloadFolder + "/spark-" + version + "-bin-hadoop2.6.tgz");
       String downloadURL =
@@ -79,6 +78,8 @@ public class SparkDownloadUtils {
       return targetFlinkHomeFolder.getAbsolutePath();
     }
     // Try mirrors a few times until one succeeds
+    boolean downloaded = false;
+    // Try mirrors a few times until one succeeds
     for (int i = 0; i < 3; i++) {
       try {
         String preferredMirror = IOUtils.toString(new URL("https://www.apache.org/dyn/closer.lua?preferred=true"));
@@ -86,11 +87,30 @@ public class SparkDownloadUtils {
         String downloadURL = preferredMirror + "/flink/flink-" + version + "/flink-" + version
+ "-bin-hadoop27-scala_2.11.tgz";
         runShellCommand(new String[] {"wget", downloadURL, "-P", downloadFolder});
         runShellCommand(new String[]{"tar", "-xvf", downloadFile.getAbsolutePath(), "-C",
downloadFolder});
+        downloaded = true;
         break;
       } catch (Exception e) {
         LOGGER.warn("Failed to download Flink", e);
       }
     }
+
+    // fallback to use apache archive
+    if (!downloaded) {
+      File downloadFile = new File(downloadFolder + "/flink-" + version + "-bin-hadoop27-scala_2.11.tgz");
+      String downloadURL =
+          "https://archive.apache.org/dist/flink/flink-"
+              + version
+              + "/flink-"
+              + version
+              + "-bin-hadoop27-scala_2.11.tgz";
+      try {
+        runShellCommand(new String[] {"wget", downloadURL, "-P", downloadFolder});
+        runShellCommand(
+            new String[] {"tar", "-xvf", downloadFile.getAbsolutePath(), "-C", downloadFolder});
+      } catch (Exception e) {
+        throw new RuntimeException("Fail to download flink " + version, e);
+      }
+    }
     return targetFlinkHomeFolder.getAbsolutePath();
   }
 


Mime
View raw message