use of org.apache.zeppelin.interpreter.launcher.InterpreterLauncher in project zeppelin by apache.
the class InterpreterSetting method createInterpreterProcess.
synchronized RemoteInterpreterProcess createInterpreterProcess(String interpreterGroupId, String userName, Properties properties) throws IOException {
InterpreterLauncher launcher = createLauncher(properties);
InterpreterLaunchContext launchContext = new InterpreterLaunchContext(properties, option, interpreterRunner, userName, interpreterGroupId, id, group, name, interpreterEventServer.getPort(), interpreterEventServer.getHost());
RemoteInterpreterProcess process = (RemoteInterpreterProcess) launcher.launch(launchContext);
recoveryStorage.onInterpreterClientStart(process);
return process;
}
use of org.apache.zeppelin.interpreter.launcher.InterpreterLauncher in project zeppelin by apache.
the class PluginManager method loadInterpreterLauncher.
public synchronized InterpreterLauncher loadInterpreterLauncher(String launcherPlugin, RecoveryStorage recoveryStorage) throws IOException {
if (cachedLaunchers.containsKey(launcherPlugin)) {
return cachedLaunchers.get(launcherPlugin);
}
String launcherClassName = "org.apache.zeppelin.interpreter.launcher." + launcherPlugin;
LOGGER.info("Loading Interpreter Launcher Plugin: {}", launcherClassName);
if (builtinLauncherClassNames.contains(launcherClassName) || Boolean.parseBoolean(System.getProperty("zeppelin.isTest", "false"))) {
try {
return (InterpreterLauncher) (Class.forName(launcherClassName)).getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class).newInstance(zConf, recoveryStorage);
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) {
throw new IOException("Fail to instantiate InterpreterLauncher from classpath directly:" + launcherClassName, e);
}
}
URLClassLoader pluginClassLoader = getPluginClassLoader(pluginsDir, "Launcher", launcherPlugin);
InterpreterLauncher launcher = null;
try {
launcher = (InterpreterLauncher) (Class.forName(launcherClassName, true, pluginClassLoader)).getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class).newInstance(zConf, recoveryStorage);
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) {
throw new IOException("Fail to instantiate Launcher " + launcherPlugin + " from plugin pluginDir: " + pluginsDir, e);
}
cachedLaunchers.put(launcherPlugin, launcher);
return launcher;
}
Aggregations