mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
ZEPPELIN-923: Apply new interpreter mechanism to Shell interpreter
This commit is contained in:
parent
411b61210d
commit
b70d650058
2 changed files with 15 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
15
shell/src/main/resources/interpreter-setting.json
Normal file
15
shell/src/main/resources/interpreter-setting.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in a new issue