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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6ea94f2  [ZEPPELIN-5405] ClassNotFoundException in YarnAppMonitor when 
hadoop client is not installed
6ea94f2 is described below

commit 6ea94f27b48b4f637cf4e7284b5b24b0fc374fe6
Author: Jeff Zhang <[email protected]>
AuthorDate: Wed Jun 16 22:59:16 2021 +0800

    [ZEPPELIN-5405] ClassNotFoundException in YarnAppMonitor when hadoop client 
is not installed
    
    ### What is this PR for?
    
    Minor PR to only use YarnAppMonitor when hadoop client is installed, 
otherwise ClassNotFoundException will be thrown
    
    ### What type of PR is it?
    [ Improvement ]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5405
    
    ### How should this be tested?
    * 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 <[email protected]>
    
    Closes #4141 from zjffdu/ZEPPELIN-5405 and squashes the following commits:
    
    06e9af7241 [Jeff Zhang] address comment
    5ff3585834 [Jeff Zhang] [ZEPPELIN-5405] ClassNotFoundException in 
YarnAppMonitor when hadoop client is not installed
---
 .../interpreter/remote/ExecRemoteInterpreterProcess.java    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/ExecRemoteInterpreterProcess.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/ExecRemoteInterpreterProcess.java
index fcabaab..dd81e57 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/ExecRemoteInterpreterProcess.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/remote/ExecRemoteInterpreterProcess.java
@@ -95,7 +95,9 @@ public class ExecRemoteInterpreterProcess extends 
RemoteInterpreterManagedProces
 
     if (!interpreterProcessLauncher.isRunning()) {
       throw new IOException("Fail to launch interpreter process:\n" + 
interpreterProcessLauncher.getErrorMessage());
-    } else {
+    }
+
+    if (isHadoopClientAvailable()) {
       String launchOutput = 
interpreterProcessLauncher.getProcessLaunchOutput();
       Matcher m = YARN_APP_PATTER.matcher(launchOutput);
       if (m.find()) {
@@ -106,6 +108,15 @@ public class ExecRemoteInterpreterProcess extends 
RemoteInterpreterManagedProces
     }
   }
 
+  private boolean isHadoopClientAvailable() {
+    try {
+      Class.forName("org.apache.hadoop.yarn.conf.YarnConfiguration");
+      return true;
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
+  }
+
   @Override
   public void processStarted(int port, String host) {
     super.processStarted(port, host);

Reply via email to