Reamer commented on a change in pull request #4097:
URL: https://github.com/apache/zeppelin/pull/4097#discussion_r655079099



##########
File path: 
zeppelin-plugins/launcher/yarn/src/main/java/org/apache/zeppelin/interpreter/launcher/YarnRemoteInterpreterProcess.java
##########
@@ -259,13 +266,48 @@ private ContainerLaunchContext setUpAMLaunchContext() 
throws IOException {
       FileUtils.forceDelete(flinkZip);
 
       String hiveConfDir = 
launchContext.getProperties().getProperty("HIVE_CONF_DIR");
-      if (!org.apache.commons.lang3.StringUtils.isBlank(hiveConfDir)) {
+      if (!StringUtils.isBlank(hiveConfDir)) {
         File hiveConfZipFile = createHiveConfZip(new File(hiveConfDir));
         srcPath = localFs.makeQualified(new Path(hiveConfZipFile.toURI()));
         destPath = copyFileToRemote(stagingDir, srcPath, (short) 1);
         addResource(fs, destPath, localResources, LocalResourceType.ARCHIVE, 
"hive_conf");
       }
     }
+
+    String yarnDistArchives = 
launchContext.getProperties().getProperty("zeppelin.yarn.dist.archives");
+    if (StringUtils.isNotBlank(yarnDistArchives)) {
+      for (String distArchive : yarnDistArchives.split(",")) {
+        URI distArchiveURI = null;
+        try {
+          distArchiveURI = new URI(distArchive);
+        } catch (URISyntaxException e) {
+          throw new IOException("Invalid uri: " + distArchive, e);
+        }
+        if (distArchiveURI.getScheme() == null || 
"file".equals(distArchiveURI.getScheme())) {
+          // zeppelin.yarn.dist.archives is local file
+          srcPath = localFs.makeQualified(new Path(distArchiveURI));
+          destPath = copyFileToRemote(stagingDir, srcPath, (short) 1);
+        } else {
+          // zeppelin.yarn.dist.archives is files on any hadoop compatible 
file system
+          destPath = new Path(removeLink(distArchive));

Review comment:
       `removeLink` sounds wrong at this point. I think `removeFragment` sounds 
better.
   https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax

##########
File path: 
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
##########
@@ -67,7 +67,7 @@ public String getProtocol() {
   }
 
   public synchronized void send(String serializeMessage) throws IOException {
-    connection.getRemote().sendStringByFuture(serializeMessage);
+    connection.getRemote().sendString(serializeMessage);

Review comment:
       This line should not be part of this PR.

##########
File path: 
zeppelin-plugins/launcher/yarn/src/main/java/org/apache/zeppelin/interpreter/launcher/YarnRemoteInterpreterProcess.java
##########
@@ -259,13 +266,48 @@ private ContainerLaunchContext setUpAMLaunchContext() 
throws IOException {
       FileUtils.forceDelete(flinkZip);
 
       String hiveConfDir = 
launchContext.getProperties().getProperty("HIVE_CONF_DIR");
-      if (!org.apache.commons.lang3.StringUtils.isBlank(hiveConfDir)) {
+      if (!StringUtils.isBlank(hiveConfDir)) {
         File hiveConfZipFile = createHiveConfZip(new File(hiveConfDir));
         srcPath = localFs.makeQualified(new Path(hiveConfZipFile.toURI()));
         destPath = copyFileToRemote(stagingDir, srcPath, (short) 1);
         addResource(fs, destPath, localResources, LocalResourceType.ARCHIVE, 
"hive_conf");
       }
     }
+
+    String yarnDistArchives = 
launchContext.getProperties().getProperty("zeppelin.yarn.dist.archives");
+    if (StringUtils.isNotBlank(yarnDistArchives)) {
+      for (String distArchive : yarnDistArchives.split(",")) {
+        URI distArchiveURI = null;
+        try {
+          distArchiveURI = new URI(distArchive);
+        } catch (URISyntaxException e) {
+          throw new IOException("Invalid uri: " + distArchive, e);
+        }
+        if (distArchiveURI.getScheme() == null || 
"file".equals(distArchiveURI.getScheme())) {

Review comment:
       A null check is not required at this point.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to