zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabhjyotsi...@apache.org
Subject zeppelin git commit: [ZEPPELIN-3240] Zeppelin server fail to start if interpreter has mixed properties
Date Mon, 19 Feb 2018 04:23:44 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master bfb04af39 -> 7d2710e8b


[ZEPPELIN-3240] Zeppelin server fail to start if interpreter has mixed properties

### What is this PR for?
I found that Zeppelin server is failing to start when there is a mix of both kind of properties
in interpreter;

```
"properties": {
        "shell.command.timeout.millisecs": {
          "type": "string",
          "name": "shell.command.timeout.millisecs",
          "value": "60000"
        },
        "shell.working.directory.user.home": {
          "type": "checkbox",
          "name": "shell.working.directory.user.home",
          "value": false
        },
        "zeppelin.shell.auth.type": "KERBEROS",
        "zeppelin.shell.keytab.location": "/etc/security/keytabs/zeppelin.server.kerberos.keytab",
        "zeppelin.shell.principal": "zeppelinEXAMPLE.COM"
      }
```

Mix as in these two kind of properties:

 - Where key is string and value is object
```
"shell.command.timeout.millisecs": {
          "type": "string",
          "name": "shell.command.timeout.millisecs",
          "value": "60000"
        }
```

 - Where key and value both are string
```
"zeppelin.shell.auth.type": "KERBEROS"
```

### What type of PR is it?
[Bug Fix]

### What is the Jira issue?
* [ZEPPELIN-3240](https://issues.apache.org/jira/browse/ZEPPELIN-3240)

### How should this be tested?
* Place this [interpreter.json](https://issues.apache.org/jira/secure/attachment/12910862/interpreter.json)
in Z-server conf folder and try to start Z-Server, with this patch it should start.

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes #2805 from prabhjyotsingh/ZEPPELIN-3240 and squashes the following commits:

8545ecd [Prabhjyot Singh] ZEPPELIN-3240: Zeppelin server fail to start if interpreter has
mixed properties


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

Branch: refs/heads/master
Commit: 7d2710e8bf5d46a389868c4477f773afbe691830
Parents: bfb04af
Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Authored: Fri Feb 16 10:02:46 2018 +0530
Committer: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Committed: Mon Feb 19 09:53:20 2018 +0530

----------------------------------------------------------------------
 .../zeppelin/interpreter/InterpreterSetting.java      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7d2710e8/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
index bb44737..ff4626d 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
@@ -26,7 +26,6 @@ import com.google.gson.JsonObject;
 import com.google.gson.annotations.SerializedName;
 import com.google.gson.internal.StringMap;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.apache.zeppelin.dep.Dependency;
 import org.apache.zeppelin.dep.DependencyResolver;
@@ -45,19 +44,13 @@ import org.apache.zeppelin.interpreter.remote.RemoteInterpreter;
 import org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventPoller;
 import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess;
 import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcessListener;
-import org.apache.zeppelin.interpreter.remote.RemoteInterpreterUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -906,6 +899,13 @@ public class InterpreterSetting {
               // in case user forget to specify type in interpreter-setting.json
           );
           newProperties.put(key, property);
+        } else if (value instanceof String) {
+          InterpreterProperty newProperty = new InterpreterProperty(
+              key,
+              value,
+              "string");
+
+          newProperties.put(newProperty.getName(), newProperty);
         } else {
           throw new RuntimeException("Can not convert this type of property: " +
               value.getClass());


Mime
View raw message