This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new d54d1a5  [ZEPPELIN-5091]. No cache for downloading artifacts of 
flink.execution.packages
d54d1a5 is described below

commit d54d1a520e0b5b8df3595ef4ae4f8d7d018e3d3b
Author: Jeff Zhang <zjf...@apache.org>
AuthorDate: Sun Oct 11 23:37:05 2020 +0800

    [ZEPPELIN-5091]. No cache for downloading artifacts of 
flink.execution.packages
    
    ### What is this PR for?
    
    This root cause of this issue is that we always create a temp folder for 
downloading artifacts, and the temp folder will change for each flink 
interpreter, that cause it would download artifacts every time, no cache is 
enabled. This PR is to use the local maven repository folder as the flink 
repository folder. So that it could reuse the downloaded artifacts.
    
    ### What type of PR is it?
    [Improvement]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5091
    
    ### How should this be tested?
    * CI pass, manually tested
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Jeff Zhang <zjf...@apache.org>
    
    Closes #3939 from zjffdu/ZEPPELIN-5091 and squashes the following commits:
    
    71014c623 [Jeff Zhang] [ZEPPELIN-5091]. No cache for downloading artifacts 
of flink.execution.packages
    
    (cherry picked from commit 6629db7484fa16cb3d1ae439861b32edf916d96c)
    Signed-off-by: Jeff Zhang <zjf...@apache.org>
---
 .../main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
 
b/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
index 000313e..63dde3f 100644
--- 
a/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
+++ 
b/flink/interpreter/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala
@@ -788,10 +788,9 @@ class FlinkScalaInterpreter(val properties: Properties) {
     val flinkPackageJars =
       if 
(!StringUtils.isBlank(properties.getProperty("flink.execution.packages", ""))) {
         val packages = properties.getProperty("flink.execution.packages")
-        val dependencyDir = 
Files.createTempDirectory("zeppelin-flink-dep").toFile
-        val dependencyResolver = new 
DependencyResolver(dependencyDir.getAbsolutePath)
+        val dependencyResolver = new 
DependencyResolver(System.getProperty("user.home") + "/.m2/repository")
         packages.split(",")
-          .flatMap(e => 
JavaConversions.asScalaBuffer(dependencyResolver.load(e, dependencyDir)))
+          .flatMap(e => 
JavaConversions.asScalaBuffer(dependencyResolver.load(e)))
           .map(e => e.getAbsolutePath).toSeq
       } else {
         Seq.empty[String]

Reply via email to