Search in sources :

Example 1 with InterpreterRunner

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;
}
Also used : InterpreterOption(org.apache.zeppelin.interpreter.InterpreterOption) InterpreterRunner(org.apache.zeppelin.interpreter.InterpreterRunner) IOException(java.io.IOException)

Example 2 with InterpreterRunner

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());
    }
}
Also used : InterpreterOption(org.apache.zeppelin.interpreter.InterpreterOption) InterpreterRunner(org.apache.zeppelin.interpreter.InterpreterRunner) RemoteInterpreterRunningProcess(org.apache.zeppelin.interpreter.remote.RemoteInterpreterRunningProcess) ExecRemoteInterpreterProcess(org.apache.zeppelin.interpreter.remote.ExecRemoteInterpreterProcess)

Aggregations

InterpreterOption (org.apache.zeppelin.interpreter.InterpreterOption)2 InterpreterRunner (org.apache.zeppelin.interpreter.InterpreterRunner)2 IOException (java.io.IOException)1 ExecRemoteInterpreterProcess (org.apache.zeppelin.interpreter.remote.ExecRemoteInterpreterProcess)1 RemoteInterpreterRunningProcess (org.apache.zeppelin.interpreter.remote.RemoteInterpreterRunningProcess)1