use of org.apache.zeppelin.helium.Application in project zeppelin by apache.
the class RemoteInterpreterServer method loadApplication.
@Override
public RemoteApplicationResult loadApplication(String applicationInstanceId, String packageInfo, String noteId, String paragraphId) throws InterpreterRPCException, TException {
if (runningApplications.containsKey(applicationInstanceId)) {
LOGGER.warn("Application instance {} is already running", applicationInstanceId);
return new RemoteApplicationResult(true, "");
}
HeliumPackage pkgInfo = HeliumPackage.fromJson(packageInfo);
ApplicationContext context = getApplicationContext(pkgInfo, noteId, paragraphId, applicationInstanceId);
try {
Application app = null;
LOGGER.info("Loading application {}({}), artifact={}, className={} into note={}, paragraph={}", pkgInfo.getName(), applicationInstanceId, pkgInfo.getArtifact(), pkgInfo.getClassName(), noteId, paragraphId);
app = appLoader.load(pkgInfo, context);
runningApplications.put(applicationInstanceId, new RunningApplication(pkgInfo, app, noteId, paragraphId));
return new RemoteApplicationResult(true, "");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return new RemoteApplicationResult(false, e.getMessage());
}
}
Aggregations