Examples of PigJob


Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

                              @Context UriInfo ui,
                              @PathParam("jobId") String jobId,
                              @PathParam("fileName") String fileName,
                              @QueryParam("page") Long page) {
    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;
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

                         @Context UriInfo ui) {
    try {
      request.validatePOST();
      getResourceManager().create(request.job);

      PigJob job = null;

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

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

        new OnlyOwnersFilteringStrategy(this.context.getUsername())));
  }

  @Override
  public void createResource(String s, Map<String, Object> stringObjectMap) throws SystemException, ResourceAlreadyExistsException, NoSuchResourceException, UnsupportedPropertyException {
    PigJob job = null;
    try {
      job = new PigJob(stringObjectMap);
    } catch (InvocationTargetException e) {
      throw new SystemException("error on creating resource", e);
    } catch (IllegalAccessException e) {
      throw new SystemException("error on creating resource", e);
    }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

    getResourceManager().create(job);
  }

  @Override
  public boolean updateResource(String resourceId, Map<String, Object> stringObjectMap) throws SystemException, NoSuchResourceException, UnsupportedPropertyException {
    PigJob job = null;
    try {
      job = new PigJob(stringObjectMap);
    } catch (InvocationTargetException e) {
      throw new SystemException("error on updating resource", e);
    } catch (IllegalAccessException e) {
      throw new SystemException("error on updating resource", e);
    }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

  private void setupPolling() {
    List<PigJob> notCompleted = this.readAll(new FilteringStrategy() {
      @Override
      public boolean isConform(Indexed item) {
        PigJob job = (PigJob) item;
        return job.isInProgress();
      }
    });

    for(PigJob job : notCompleted) {
      JobPolling.pollJob(context, job);
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

  }

  @Override
  public PigJob create(PigJob object) {
    object.setStatus(PigJob.Status.SUBMITTING);
    PigJob job = super.create(object);
    LOG.debug("Submitting job...");

    try {
      submitJob(object);
    } catch (RuntimeException e) {
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

    return doCreateJob(title, pigScript, templetonArguments, null);
  }

  private Response doCreateJob(String title, String pigScript, String templetonArguments, String forcedContent) {
    JobService.PigJobRequest request = new JobService.PigJobRequest();
    request.job = new PigJob();
    request.job.setTitle(title);
    request.job.setPigScript(pigScript);
    request.job.setTempletonArguments(templetonArguments);
    request.job.setForcedContent(forcedContent);
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

    Assert.assertTrue(obj.containsKey("job"));
    Assert.assertNotNull(((PigJob) obj.get("job")).getId());
    Assert.assertFalse(((PigJob) obj.get("job")).getId().isEmpty());
    Assert.assertTrue(((PigJob) obj.get("job")).getStatusDir().startsWith("/tmp/.pigjobs/ambari-qa/test"));

    PigJob job = ((PigJob) obj.get("job"));
    Assert.assertEquals(PigJob.Status.SUBMITTED, job.getStatus());
    Assert.assertTrue(job.isInProgress());
  }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

    Assert.assertTrue(obj.containsKey("job"));
    Assert.assertNotNull(((PigJob) obj.get("job")).getId());
    Assert.assertFalse(((PigJob) obj.get("job")).getId().isEmpty());
    Assert.assertTrue(((PigJob) obj.get("job")).getStatusDir().startsWith("/tmp/.pigjobs/ambari-qa/test"));

    PigJob job = ((PigJob) obj.get("job"));
    Assert.assertEquals(PigJob.Status.SUBMITTED, job.getStatus());
    Assert.assertTrue(job.isInProgress());
  }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.jobs.models.PigJob

    reset(api);
    api.killJob(eq("job_id_##"));
    replay(api);
    JSONObject obj = (JSONObject)response.getEntity();
    PigJob job = ((PigJob)obj.get("job"));
    response = jobService.killJob(job.getId());
    Assert.assertEquals(204, response.getStatus());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.