本文整理汇总了Java中org.apache.zeppelin.helium.HeliumPackage类的典型用法代码示例。如果您正苦于以下问题:Java HeliumPackage类的具体用法?Java HeliumPackage怎么用?Java HeliumPackage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HeliumPackage类属于org.apache.zeppelin.helium包,在下文中一共展示了HeliumPackage类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@POST
@Path("load/{noteId}/{paragraphId}")
public Response load(@PathParam("noteId") String noteId,
@PathParam("paragraphId") String paragraphId,
String heliumPackage) {
Note note = notebook.getNote(noteId);
if (note == null) {
return new JsonResponse(Response.Status.NOT_FOUND, "Note " + noteId + " not found").build();
}
Paragraph paragraph = note.getParagraph(paragraphId);
if (paragraph == null) {
return new JsonResponse(Response.Status.NOT_FOUND, "Paragraph " + paragraphId + " not found")
.build();
}
HeliumPackage pkg = HeliumPackage.fromJson(heliumPackage);
try {
return new JsonResponse<>(Response.Status.OK, "",
helium.getApplicationFactory().loadAndRun(pkg, paragraph)).build();
}
catch (RuntimeException e) {
logger.error(e.getMessage(), e);
return new JsonResponse(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
}
}
示例2: load
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@POST
@Path("load/{noteId}/{paragraphId}")
public Response load(@PathParam("noteId") String noteId,
@PathParam("paragraphId") String paragraphId,
String heliumPackage) {
Note note = notebook.getNote(noteId);
if (note == null) {
return new JsonResponse(Response.Status.NOT_FOUND, "Note " + noteId + " not found").build();
}
Paragraph paragraph = note.getParagraph(paragraphId);
if (paragraph == null) {
return new JsonResponse(Response.Status.NOT_FOUND, "Paragraph " + paragraphId + " not found")
.build();
}
HeliumPackage pkg = HeliumPackage.fromJson(heliumPackage);
try {
return new JsonResponse<>(Response.Status.OK, "",
helium.getApplicationFactory().loadAndRun(pkg, paragraph)).build();
} catch (RuntimeException e) {
logger.error(e.getMessage(), e);
return new JsonResponse(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
}
}
示例3: equals
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
String compareName;
if (o instanceof ApplicationState) {
return pkg.equals(((ApplicationState) o).getHeliumPackage());
} else if (o instanceof HeliumPackage) {
return pkg.equals((HeliumPackage) o);
} else {
return false;
}
}
示例4: createOrGetApplicationState
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public ApplicationState createOrGetApplicationState(HeliumPackage pkg) {
synchronized (apps) {
for (ApplicationState as : apps) {
if (as.equals(pkg)) {
return as;
}
}
String appId = getApplicationId(pkg);
ApplicationState appState = new ApplicationState(appId, pkg);
apps.add(appState);
return appState;
}
}
示例5: getApplicationContext
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
private ApplicationContext getApplicationContext(
HeliumPackage packageInfo, String noteId, String paragraphId, String applicationInstanceId) {
InterpreterOutput out = createAppOutput(noteId, paragraphId, applicationInstanceId);
return new ApplicationContext(
noteId,
paragraphId,
applicationInstanceId,
new HeliumAppAngularObjectRegistry(angularObjectRegistry, noteId, applicationInstanceId),
out);
}
示例6: loadApplication
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@Override
public RemoteApplicationResult loadApplication(
String applicationInstanceId, String packageInfo, String noteId, String paragraphId)
throws TException {
if (runningApplications.containsKey(applicationInstanceId)) {
logger.warn("Application instance {} is already running");
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());
}
}
示例7: RunningApplication
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public RunningApplication(HeliumPackage pkg,
Application app,
String noteId,
String paragraphId) {
this.app = app;
this.pkg = pkg;
this.noteId = noteId;
this.paragraphId = paragraphId;
}
示例8: ApplicationState
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public ApplicationState(String id, HeliumPackage pkg) {
this.id = id;
this.pkg = pkg;
}
示例9: getHeliumPackage
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public HeliumPackage getHeliumPackage() {
return pkg;
}
示例10: getApplicationId
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
private String getApplicationId(HeliumPackage pkg) {
return "app_" + getNote().getId() + "-" + getId() + pkg.getName().replaceAll("\\.", "_");
}
示例11: onLoad
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@Override
public void onLoad(String noteId, String paragraphId, String appId, HeliumPackage pkg) {
Message msg = new Message(OP.APP_LOAD).put("noteId", noteId).put("paragraphId", paragraphId)
.put("appId", appId).put("pkg", pkg);
broadcast(noteId, msg);
}
示例12: onLoad
import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
@Override
public void onLoad(String noteId, String paragraphId, String appId, HeliumPackage pkg) {
Message msg = new Message(Message.OP.APP_LOAD).put("noteId", noteId).put("paragraphId", paragraphId)
.put("appId", appId).put("pkg", pkg);
broadcast(noteId, msg);
}