Package org.apache.ambari.view.pig.utils

Examples of org.apache.ambari.view.pig.utils.NotFoundFormattedException


          }
          return job;
        }
      });
      if (job == null)
        throw new NotFoundFormattedException("Job with id '" + jobId + "' not found", null);

      getResourceManager().retrieveJobStatus(job);
      return Response.ok().build();
    } catch (WebApplicationException ex) {
      throw ex;
View Full Code Here


    try {
      PigJob job = null;
      try {
        job = getResourceManager().read(jobId);
      } catch (ItemNotFound itemNotFound) {
        throw new NotFoundFormattedException("Job with id '" + jobId + "' not found", null);
      }
      String filePath = job.getStatusDir() + "/" + fileName;
      LOG.debug("Reading file " + filePath);
      FilePaginator paginator = new FilePaginator(filePath, context);

      if (page == null)
        page = 0L;

      FileResource file = new FileResource();
      file.setFilePath(filePath);
      file.setFileContent(paginator.readPage(page));
      file.setHasNext(paginator.pageCount() > page + 1);
      file.setPage(page);
      file.setPageCount(paginator.pageCount());

      JSONObject object = new JSONObject();
      object.put("file", file);
      return Response.ok(object).status(200).build();
    } catch (WebApplicationException ex) {
      throw ex;
    } catch (IOException ex) {
      throw new NotFoundFormattedException(ex.getMessage(), ex);
    } catch (InterruptedException ex) {
      throw new NotFoundFormattedException(ex.getMessage(), ex);
    } catch (Exception ex) {
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
  }
View Full Code Here

      PigJob job = null;

      try {
        job = getResourceManager().read(request.job.getId());
      } catch (ItemNotFound itemNotFound) {
        throw new NotFoundFormattedException("Job not found", null);
      }

      response.setHeader("Location",
          String.format("%s/%s", ui.getAbsolutePath().toString(), request.job.getId()));
View Full Code Here

TOP

Related Classes of org.apache.ambari.view.pig.utils.NotFoundFormattedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.