当前位置: 首页>>代码示例>>Java>>正文


Java HeliumPackage类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:27,代码来源:HeliumRestApi.java

示例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();
  }
}
 
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:26,代码来源:HeliumRestApi.java

示例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;
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:12,代码来源:ApplicationState.java

示例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;
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:15,代码来源:Paragraph.java

示例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);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:11,代码来源:RemoteInterpreterServer.java

示例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());
  }
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:32,代码来源:RemoteInterpreterServer.java

示例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;
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:10,代码来源:RemoteInterpreterServer.java

示例8: ApplicationState

import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public ApplicationState(String id, HeliumPackage pkg) {
  this.id = id;
  this.pkg = pkg;
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:5,代码来源:ApplicationState.java

示例9: getHeliumPackage

import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
public HeliumPackage getHeliumPackage() {
  return pkg;
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:4,代码来源:ApplicationState.java

示例10: getApplicationId

import org.apache.zeppelin.helium.HeliumPackage; //导入依赖的package包/类
private String getApplicationId(HeliumPackage pkg) {
  return "app_" + getNote().getId() + "-" + getId() + pkg.getName().replaceAll("\\.", "_");
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:4,代码来源:Paragraph.java

示例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);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:7,代码来源:NotebookServer.java

示例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);
}
 
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:7,代码来源:NotebookServerImpl.java


注:本文中的org.apache.zeppelin.helium.HeliumPackage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。