From b70d650058d066c898e447054da1d9279b2ef19f Mon Sep 17 00:00:00 2001 From: AhyoungRyu Date: Fri, 3 Jun 2016 09:16:20 -0700 Subject: [PATCH 1/3] ZEPPELIN-923: Apply new interpreter mechanism to Shell interpreter --- .../apache/zeppelin/shell/ShellInterpreter.java | 15 --------------- shell/src/main/resources/interpreter-setting.json | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 shell/src/main/resources/interpreter-setting.json diff --git a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java index e3c4d0c0f31..13312252654 100644 --- a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java +++ b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java @@ -45,27 +45,12 @@ public class ShellInterpreter extends Interpreter { Logger logger = LoggerFactory.getLogger(ShellInterpreter.class); private static final String EXECUTOR_KEY = "executor"; public static final String SHELL_COMMAND_TIMEOUT = "shell.command.timeout.millisecs"; - public static final String DEFAULT_COMMAND_TIMEOUT = "600000"; int commandTimeOut; private static final boolean isWindows = System .getProperty("os.name") .startsWith("Windows"); final String shell = isWindows ? "cmd /c" : "bash -c"; - static { - Interpreter.register( - "sh", - "sh", - ShellInterpreter.class.getName(), - new InterpreterPropertyBuilder() - .add( - SHELL_COMMAND_TIMEOUT, - DEFAULT_COMMAND_TIMEOUT, - "Shell command time out in millisecs. Default = 600000") - .build() - ); - } - public ShellInterpreter(Properties property) { super(property); } diff --git a/shell/src/main/resources/interpreter-setting.json b/shell/src/main/resources/interpreter-setting.json new file mode 100644 index 00000000000..e5f6c58ac07 --- /dev/null +++ b/shell/src/main/resources/interpreter-setting.json @@ -0,0 +1,15 @@ +[ + { + "group": "sh", + "name": "sh", + "className": "org.apache.zeppelin.shell.ShellInterpreter", + "properties": { + "shell.command.timeout.millisecs": { + "envName": "SHELL_COMMAND_TIMEOUT", + "propertyName": "shell.command.timeout.millisecs", + "defaultValue": "5000", + "description": "Shell command time out in millisecs. Default = 5000" + } + } + } +] \ No newline at end of file From be3e22ea75886664e5d084437e85738a00235068 Mon Sep 17 00:00:00 2001 From: AhyoungRyu Date: Fri, 3 Jun 2016 09:18:51 -0700 Subject: [PATCH 2/3] ZEPPELIN-923: Change defaultValue 5000 -> 60000 --- shell/src/main/resources/interpreter-setting.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/src/main/resources/interpreter-setting.json b/shell/src/main/resources/interpreter-setting.json index e5f6c58ac07..5e9a051a2eb 100644 --- a/shell/src/main/resources/interpreter-setting.json +++ b/shell/src/main/resources/interpreter-setting.json @@ -7,8 +7,8 @@ "shell.command.timeout.millisecs": { "envName": "SHELL_COMMAND_TIMEOUT", "propertyName": "shell.command.timeout.millisecs", - "defaultValue": "5000", - "description": "Shell command time out in millisecs. Default = 5000" + "defaultValue": "60000", + "description": "Shell command time out in millisecs. Default = 60000" } } } From 3df8c7d878bbcc8678b1d0a73f7b4e2dfc5cb925 Mon Sep 17 00:00:00 2001 From: AhyoungRyu Date: Sat, 4 Jun 2016 20:44:26 -0700 Subject: [PATCH 3/3] ZEPPELIN-923: exclude interpreter-setting.json --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 8799ff687a8..970f6cbe457 100755 --- a/pom.xml +++ b/pom.xml @@ -475,6 +475,7 @@ conf/zeppelin-env.sh spark-*-bin*/** .spark-dist/** + **/interpreter-setting.json docs/assets/themes/zeppelin/bootstrap/**