@Override public JobState getState() { return report.getJobState(); }
public void waitForState(Job job, JobState finalState) throws Exception { int timeoutSecs = 0; JobReport report = job.getReport(); while (!finalState.equals(report.getJobState()) && timeoutSecs++ < 20) { System.out.println("Job State is : " + report.getJobState() + " Waiting for state : " + finalState + " map progress : " + report.getMapProgress() + " reduce progress : " + report.getReduceProgress()); report = job.getReport(); Thread.sleep(500); } System.out.println("Job State is : " + report.getJobState()); Assert.assertEquals("Job state is not correct (timedout)", finalState, job.getState()); }
userUrl = userUrl.replace(JOB_STATUS, jobReport.getJobState().toString());
userUrl = userUrl.replace(JOB_STATUS, jobReport.getJobState().toString());
continue; if (jobState != null && jobState != report.getJobState()) { continue;
userUrl = userUrl.replace(JOB_STATUS, jobReport.getJobState().toString());
continue; if (jobState != null && jobState != report.getJobState()) { continue;
continue; if (jobState != null && jobState != report.getJobState()) { continue;
/** * Runs memory and time benchmark with Mock MRApp. * @param app Application to submit * @throws Exception On application failure */ public void run(MRApp app) throws Exception { GenericTestUtils.setRootLogLevel(Level.WARN); long startTime = System.currentTimeMillis(); Job job = app.submit(new Configuration()); while (!job.getReport().getJobState().equals(JobState.SUCCEEDED)) { printStat(job, startTime); Thread.sleep(2000); } printStat(job, startTime); }
GetJobReportRequest.class, request)).getJobReport(); if (EnumSet.of(JobState.SUCCEEDED, JobState.FAILED, JobState.KILLED, JobState.ERROR).contains(report.getJobState())) { if (oldTaskAttemptID != null) { GetTaskAttemptReportRequest taRequest =
GetJobReportRequest.class, request)).getJobReport(); if (EnumSet.of(JobState.SUCCEEDED, JobState.FAILED, JobState.KILLED, JobState.ERROR).contains(report.getJobState())) { if (oldTaskAttemptID != null) { GetTaskAttemptReportRequest taRequest =
public static JobStatus fromYarn(JobReport jobreport, String trackingUrl) { JobPriority jobPriority = JobPriority.NORMAL; JobStatus jobStatus = new org.apache.hadoop.mapred.JobStatus( fromYarn(jobreport.getJobId()), jobreport.getSetupProgress(), jobreport .getMapProgress(), jobreport.getReduceProgress(), jobreport .getCleanupProgress(), fromYarn(jobreport.getJobState()), jobPriority, jobreport.getUser(), jobreport.getJobName(), jobreport .getJobFile(), trackingUrl, jobreport.isUber()); jobStatus.setStartTime(jobreport.getStartTime()); jobStatus.setFinishTime(jobreport.getFinishTime()); jobStatus.setFailureInfo(jobreport.getDiagnostics()); return jobStatus; }
public static JobStatus fromYarn(JobReport jobreport, String trackingUrl) { JobPriority jobPriority = JobPriority.NORMAL; JobStatus jobStatus = new org.apache.hadoop.mapred.JobStatus( fromYarn(jobreport.getJobId()), jobreport.getSetupProgress(), jobreport .getMapProgress(), jobreport.getReduceProgress(), jobreport .getCleanupProgress(), fromYarn(jobreport.getJobState()), jobPriority, jobreport.getUser(), jobreport.getJobName(), jobreport .getJobFile(), trackingUrl, jobreport.isUber()); jobStatus.setStartTime(jobreport.getStartTime()); jobStatus.setFinishTime(jobreport.getFinishTime()); jobStatus.setFailureInfo(jobreport.getDiagnostics()); return jobStatus; }
public static JobStatus fromYarn(JobReport jobreport, String trackingUrl) { JobPriority jobPriority = (jobreport.getJobPriority() == null) ? JobPriority.DEFAULT : fromYarnPriority(jobreport.getJobPriority().getPriority()); JobStatus jobStatus = new org.apache.hadoop.mapred.JobStatus( fromYarn(jobreport.getJobId()), jobreport.getSetupProgress(), jobreport.getMapProgress(), jobreport.getReduceProgress(), jobreport.getCleanupProgress(), fromYarn(jobreport.getJobState()), jobPriority, jobreport.getUser(), jobreport.getJobName(), jobreport.getJobFile(), trackingUrl, jobreport.isUber()); jobStatus.setStartTime(jobreport.getStartTime()); jobStatus.setFinishTime(jobreport.getFinishTime()); jobStatus.setFailureInfo(jobreport.getDiagnostics()); return jobStatus; }
public static JobStatus fromYarn(JobReport jobreport, String trackingUrl) { JobPriority jobPriority = (jobreport.getJobPriority() == null) ? JobPriority.DEFAULT : fromYarnPriority(jobreport.getJobPriority().getPriority()); JobStatus jobStatus = new org.apache.hadoop.mapred.JobStatus( fromYarn(jobreport.getJobId()), jobreport.getSetupProgress(), jobreport.getMapProgress(), jobreport.getReduceProgress(), jobreport.getCleanupProgress(), fromYarn(jobreport.getJobState()), jobPriority, jobreport.getUser(), jobreport.getJobName(), jobreport.getJobFile(), trackingUrl, jobreport.isUber(), jobreport.getHistoryFile()); jobStatus.setStartTime(jobreport.getStartTime()); jobStatus.setFinishTime(jobreport.getFinishTime()); jobStatus.setFailureInfo(jobreport.getDiagnostics()); return jobStatus; }
private void verifyJobReport(JobReport jr) { Assert.assertNotNull("JobReport is null", jr); List<AMInfo> amInfos = jr.getAMInfos(); Assert.assertEquals(1, amInfos.size()); Assert.assertEquals(JobState.RUNNING, jr.getJobState()); AMInfo amInfo = amInfos.get(0); Assert.assertEquals(MRApp.NM_HOST, amInfo.getNodeManagerHost()); Assert.assertEquals(MRApp.NM_PORT, amInfo.getNodeManagerPort()); Assert.assertEquals(MRApp.NM_HTTP_PORT, amInfo.getNodeManagerHttpPort()); Assert.assertEquals(1, amInfo.getAppAttemptId().getAttemptId()); Assert.assertEquals(1, amInfo.getContainerId().getApplicationAttemptId() .getAttemptId()); Assert.assertTrue(amInfo.getStartTime() > 0); Assert.assertEquals(false, jr.isUber()); }