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


Java HeliumPackage.fromJson方法代码示例

本文整理汇总了Java中org.apache.zeppelin.helium.HeliumPackage.fromJson方法的典型用法代码示例。如果您正苦于以下问题:Java HeliumPackage.fromJson方法的具体用法?Java HeliumPackage.fromJson怎么用?Java HeliumPackage.fromJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.zeppelin.helium.HeliumPackage的用法示例。


在下文中一共展示了HeliumPackage.fromJson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


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