Examples of JobStatus


Examples of org.apache.hadoop.mapreduce.JobStatus

    // should use the same proxy to AM2 and so instantiateProxy shouldn't be
    // called.
    doReturn(firstGenAMProxy).doReturn(secondGenAMProxy).when(
        clientServiceDelegate).instantiateAMProxy(any(InetSocketAddress.class));

    JobStatus jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("jobName-firstGen", jobStatus.getJobName());

    jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("jobName-secondGen", jobStatus.getJobName());

    jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("jobName-secondGen", jobStatus.getJobName());

    verify(clientServiceDelegate, times(2)).instantiateAMProxy(
        any(InetSocketAddress.class));
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobStatus

        getFinishedApplicationReport());

    ClientServiceDelegate clientServiceDelegate = spy(getClientServiceDelegate(
        historyServerProxy, rmDelegate));

    JobStatus jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("N/A", jobStatus.getJobName());
   
    verify(clientServiceDelegate, times(0)).instantiateAMProxy(
        any(InetSocketAddress.class));

    // Should not reach AM even for second and third times too.
    jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("N/A", jobStatus.getJobName());   
    verify(clientServiceDelegate, times(0)).instantiateAMProxy(
        any(InetSocketAddress.class));
    jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus);
    Assert.assertEquals("N/A", jobStatus.getJobName());   
    verify(clientServiceDelegate, times(0)).instantiateAMProxy(
        any(InetSocketAddress.class));

    // The third time around, app is completed, so should go to JHS
    JobStatus jobStatus1 = clientServiceDelegate.getJobStatus(oldJobId);
    Assert.assertNotNull(jobStatus1);
    Assert.assertEquals("TestJobFilePath", jobStatus1.getJobFile());                              
    Assert.assertEquals("http://TestTrackingUrl", jobStatus1.getTrackingUrl());                   
    Assert.assertEquals(1.0f, jobStatus1.getMapProgress());                                       
    Assert.assertEquals(1.0f, jobStatus1.getReduceProgress());
   
    verify(clientServiceDelegate, times(0)).instantiateAMProxy(
        any(InetSocketAddress.class));
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobStatus

            "Connection refuced1"))).thenThrow(
        new java.lang.reflect.UndeclaredThrowableException(new IOException(
            "Connection refuced2"))).thenReturn(getFinishedApplicationReport());
    ClientServiceDelegate clientServiceDelegate = new ClientServiceDelegate(
        conf, rmDelegate, oldJobId, historyServerProxy);
    JobStatus jobStatus = clientServiceDelegate.getJobStatus(oldJobId);
    verify(rmDelegate, times(3)).getApplicationReport(any(ApplicationId.class));
    Assert.assertNotNull(jobStatus);
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobStatus

  }

  @Override
  public JobStatus getJobStatus(JobID jobID) throws IOException,
      InterruptedException {
    JobStatus status = clientCache.getClient(jobID).getJobStatus(jobID);
    return status;
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobStatus

  }

  @Override
  public void killJob(JobID arg0) throws IOException, InterruptedException {
    /* check if the status is not running, if not send kill to RM */
    JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
    if (status.getState() != JobStatus.State.RUNNING) {
      resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
      return;
    }

    try {
      /* send a kill to the AM */
      clientCache.getClient(arg0).killJob(arg0);
      long currentTimeMillis = System.currentTimeMillis();
      long timeKillIssued = currentTimeMillis;
      while ((currentTimeMillis < timeKillIssued + 10000L) && (status.getState()
          != JobStatus.State.KILLED)) {
          try {
            Thread.sleep(1000L);
          } catch(InterruptedException ie) {
            /** interrupted, just break */
            break;
          }
          currentTimeMillis = System.currentTimeMillis();
          status = clientCache.getClient(arg0).getJobStatus(arg0);
      }
    } catch(IOException io) {
      LOG.debug("Error when checking for application status", io);
    }
    if (status.getState() != JobStatus.State.KILLED) {
      resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
    }
  }
View Full Code Here

Examples of org.apache.hama.bsp.JobStatus

          listArea[2] = uit.getArea(tplfile, "tasklist2");

          ServletContext ctx = getServletContext();
          BSPMaster tracker = (BSPMaster) ctx.getAttribute("bsp.master");
          ClusterStatus status = tracker.getClusterStatus(true);
          JobStatus jobStatus = tracker.getJobStatus(BSPJobID.forName(jobId));

          vars.put("hamaLogDir", hamaLogDir);
          vars.put("dirName", dirName);
          vars.put("targetUri", targetUri);
          vars.put("jobId", jobId);
          vars.put("jobStatus", jobStatus.getState().toString());
          vars.put("jobName", jobStatus.getName());

          out.println(uit.convert(listArea[0], vars));
          vars.clear();

          for (Entry<String, GroomServerStatus> entry : status
View Full Code Here

Examples of org.apache.manifoldcf.crawler.interfaces.JobStatus

        {
          IJobDescription desc = jobs[i++];
          // Wait for this job to stop
          while (true)
          {
            JobStatus status = jobManager.getStatus(desc.getID());
            if (status != null)
            {
              int statusValue = status.getStatus();
              switch (statusValue)
              {
              case JobStatus.JOBSTATUS_NOTYETRUN:
              case JobStatus.JOBSTATUS_COMPLETED:
              case JobStatus.JOBSTATUS_ERROR:
                break;
              default:
                ManifoldCF.sleep(10000);
                continue;
              }
            }
            break;
          }
        }

        // Now, delete them all
        i = 0;
        while (i < jobs.length)
        {
          IJobDescription desc = jobs[i++];
          try
          {
            jobManager.deleteJob(desc.getID());
          }
          catch (ManifoldCFException e)
          {
            // This usually means that the job is already being deleted
          }
        }

        i = 0;
        while (i < jobs.length)
        {
          IJobDescription desc = jobs[i++];
          // Wait for this job to disappear
          while (true)
          {
            JobStatus status = jobManager.getStatus(desc.getID());
            if (status != null)
            {
              ManifoldCF.sleep(10000);
              continue;
            }
View Full Code Here

Examples of org.apache.nutch.api.JobStatus

    protected void afterExecute(Runnable r, Throwable t) {
      super.afterExecute(r, t);
      synchronized(jobRunning) {
        jobRunning.remove(((JobWorker)r).jobStatus);
      }
      JobStatus status = ((JobWorker)r).jobStatus;
      synchronized(jobHistory) {
        if (!jobHistory.offer(status)) {
          jobHistory.poll();
          jobHistory.add(status);
        }
View Full Code Here

Examples of org.apache.sling.bgservlets.JobStatus

    protected void doGet(SlingHttpServletRequest request,
            SlingHttpServletResponse response) throws ServletException,
            IOException {
        try {
            final Node n = request.getResource().adaptTo(Node.class);
            final JobStatus j = jobConsole.getJobStatus(n.getSession(), n.getPath());
            final String streamPath =  j.getStreamPath();
            final String fullStreamPath = request.getContextPath() + streamPath;
            final String ext = request.getRequestPathInfo().getExtension();
            Renderer r = renderers.get(ext);
            if(r == null) {
                r = renderers.get(DEFAULT_EXT);
View Full Code Here

Examples of org.apache.sling.bgservlets.JobStatus

        JobConsolePlugin.destroyPlugin();
    }
   
    public JobStatus getJobStatus(Session session, String path) {
        // Try ExecutionEngine first, persistent storage if not found
        JobStatus result = executionEngine.getJobStatus(path);
        if(result == null) {
            try {
                if(session.itemExists(path)) {
                    final Item i = session.getItem(path);
                    if(i.isNode()) {
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.