use of org.apache.zeppelin.interpreter.InterpreterRunner in project zeppelin by apache.
the class ClusterInterpreterLauncher method createClusterIntpProcess.
private RemoteInterpreterProcess createClusterIntpProcess() {
ClusterInterpreterProcess clusterIntpProcess = null;
try {
InterpreterOption option = context.getOption();
InterpreterRunner runner = context.getRunner();
String intpSetGroupName = context.getInterpreterSettingGroup();
String intpSetName = context.getInterpreterSettingName();
int connectTimeout = getConnectTimeout();
int connectionPoolSize = getConnectPoolSize();
String localRepoPath = zConf.getInterpreterLocalRepoPath() + "/" + context.getInterpreterSettingId();
clusterIntpProcess = new ClusterInterpreterProcess(runner != null ? runner.getPath() : zConf.getInterpreterRemoteRunnerPath(), context.getIntpEventServerPort(), context.getIntpEventServerHost(), zConf.getInterpreterPortRange(), zConf.getInterpreterDir() + "/" + intpSetGroupName, localRepoPath, buildEnvFromProperties(context), connectTimeout, connectionPoolSize, intpSetName, context.getInterpreterGroupId(), option.isUserImpersonate());
} catch (IOException e) {
LOGGER.error(e.getMessage(), e);
}
return clusterIntpProcess;
}
use of org.apache.zeppelin.interpreter.InterpreterRunner in project zeppelin by apache.
the class StandardInterpreterLauncher method launchDirectly.
@Override
public InterpreterClient launchDirectly(InterpreterLaunchContext context) throws IOException {
LOGGER.info("Launching new interpreter process of {}", context.getInterpreterSettingGroup());
this.properties = context.getProperties();
InterpreterOption option = context.getOption();
InterpreterRunner runner = context.getRunner();
String groupName = context.getInterpreterSettingGroup();
String name = context.getInterpreterSettingName();
int connectTimeout = getConnectTimeout();
int connectionPoolSize = getConnectPoolSize();
if (option.isExistingProcess()) {
return new RemoteInterpreterRunningProcess(context.getInterpreterSettingName(), context.getInterpreterGroupId(), connectTimeout, connectionPoolSize, context.getIntpEventServerHost(), context.getIntpEventServerPort(), option.getHost(), option.getPort(), false);
} else {
// create new remote process
String localRepoPath = zConf.getInterpreterLocalRepoPath() + File.separator + context.getInterpreterSettingId();
return new ExecRemoteInterpreterProcess(context.getIntpEventServerPort(), context.getIntpEventServerHost(), zConf.getInterpreterPortRange(), zConf.getInterpreterDir() + "/" + groupName, localRepoPath, buildEnvFromProperties(context), connectTimeout, connectionPoolSize, name, context.getInterpreterGroupId(), option.isUserImpersonate(), runner != null ? runner.getPath() : zConf.getInterpreterRemoteRunnerPath());
}
}
Aggregations