ZEPPELIN-923: Apply new interpreter mechanism to Shell interpreter

This commit is contained in:
AhyoungRyu 2016-06-03 09:16:20 -07:00
parent 411b61210d
commit b70d650058
2 changed files with 15 additions and 15 deletions

View file

@ -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);
}

View file

@ -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"
}
}
}
]