Java Code Examples for org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants#Values

The following examples show how to use org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants#Values . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MockSimulatorEngine.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private Pre21JobHistoryConstants.Values convertState (JobStatus status) {
  int runState = status.getRunState();
  if (runState == JobStatus.FAILED) {
    return Pre21JobHistoryConstants.Values.FAILED;
  } else if (runState == JobStatus.SUCCEEDED) {
    return Pre21JobHistoryConstants.Values.SUCCESS;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
Example 2
Source File: MockSimulatorEngine.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void validateJobComplete(JobCompleteEvent completeEvent) {
  JobID jobId = completeEvent.getJobStatus().getJobID();
  JobStatus finalStatus = completeEvent.getJobStatus();

  Assert.assertTrue("Job completed was not submitted:"+jobId, 
             submittedJobs.contains(jobId));
  Assert.assertFalse("Job completed more than once:" + jobId, 
              completedJobs.contains(jobId));
  completedJobs.add(jobId);
 
  Pre21JobHistoryConstants.Values finalValue = jobs.get(jobId).getOutcome();
  Pre21JobHistoryConstants.Values obtainedStatus = convertState(finalStatus);
  Assert.assertEquals("Job completion final status mismatch", obtainedStatus,
      finalValue);
}
 
Example 3
Source File: MockSimulatorEngine.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private void validateJobSubmission(JobSubmissionEvent submissionEvent) {
  JobID jobId = submissionEvent.getJob().getJobID();
  LOG.info("Job being submitted: " + jobId);
  Assert.assertFalse("Job " + jobId + " is already submitted", submittedJobs
      .contains(jobId));
  LOG.info("Adding to submitted Jobs " + jobId);
  submittedJobs.add(jobId); 
  jobs.put(jobId, submissionEvent.getJob());
  Pre21JobHistoryConstants.Values finalValue = submissionEvent.getJob().getOutcome();
  Assert.assertTrue("Job has final state neither SUCCESS nor FAILED",
      finalValue == Pre21JobHistoryConstants.Values.FAILED
          || finalValue == Pre21JobHistoryConstants.Values.SUCCESS);
}
 
Example 4
Source File: SimulatorJobStory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Pre21JobHistoryConstants.Values getOutcome() {
  return job.getOutcome();
}
 
Example 5
Source File: TestSimulatorJobClient.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Pre21JobHistoryConstants.Values getOutcome() {
  return Pre21JobHistoryConstants.Values.SUCCESS;
}
 
Example 6
Source File: FakeJobs.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Pre21JobHistoryConstants.Values getOutcome() {
  return Pre21JobHistoryConstants.Values.SUCCESS;
}