org.apache.hadoop.mapred.jobcontrol.Job.getState()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中org.apache.hadoop.mapred.jobcontrol.Job.getState()方法的一些代码示例,展示了Job.getState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getState()方法的具体详情如下:
包路径:org.apache.hadoop.mapred.jobcontrol.Job
类名称:Job
方法名:getState

Job.getState介绍

暂无

代码示例

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

private void addToQueue(Job aJob) {
 Map<String, Job> queue = getQueue(aJob.getState());
 addToQueue(aJob, queue);    
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

private void addToQueue(Job aJob) {
 Map<String, Job> queue = getQueue(aJob.getState());
 addToQueue(aJob, queue);    
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

if (job_1.getState() != Job.FAILED && 
  job_1.getState() != Job.DEPENDENT_FAILED && 
  job_1.getState() != Job.SUCCESS) {
 String states = "job_1:  " + job_1.getState() + "\n";
 throw new Exception("The state of job_1 is not in a complete state\n" + states);
if (job_2.getState() != Job.FAILED &&
  job_2.getState() != Job.DEPENDENT_FAILED && 
  job_2.getState() != Job.SUCCESS) {
 String states = "job_2:  " + job_2.getState() + "\n";
 throw new Exception("The state of job_2 is not in a complete state\n" + states);
if (job_3.getState() != Job.FAILED && 
  job_3.getState() != Job.DEPENDENT_FAILED && 
  job_3.getState() != Job.SUCCESS) {
 String states = "job_3:  " + job_3.getState() + "\n";
 throw new Exception("The state of job_3 is not in a complete state\n" + states);
if (job_4.getState() != Job.FAILED && 
  job_4.getState() != Job.DEPENDENT_FAILED && 
  job_4.getState() != Job.SUCCESS) {
 String states = "job_4:  " + job_4.getState() + "\n";
 throw new Exception("The state of job_4 is not in a complete state\n" + states);
if (job_1.getState() == Job.FAILED ||

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

if (job_1.getState() != Job.FAILED && 
  job_1.getState() != Job.DEPENDENT_FAILED && 
  job_1.getState() != Job.SUCCESS) {
 String states = "job_1:  " + job_1.getState() + "\n";
 throw new Exception("The state of job_1 is not in a complete state\n" + states);
if (job_2.getState() != Job.FAILED &&
  job_2.getState() != Job.DEPENDENT_FAILED && 
  job_2.getState() != Job.SUCCESS) {
 String states = "job_2:  " + job_2.getState() + "\n";
 throw new Exception("The state of job_2 is not in a complete state\n" + states);
if (job_3.getState() != Job.FAILED && 
  job_3.getState() != Job.DEPENDENT_FAILED && 
  job_3.getState() != Job.SUCCESS) {
 String states = "job_3:  " + job_3.getState() + "\n";
 throw new Exception("The state of job_3 is not in a complete state\n" + states);
if (job_4.getState() != Job.FAILED && 
  job_4.getState() != Job.DEPENDENT_FAILED && 
  job_4.getState() != Job.SUCCESS) {
 String states = "job_4:  " + job_4.getState() + "\n";
 throw new Exception("The state of job_4 is not in a complete state\n" + states);
if (job_1.getState() == Job.FAILED ||

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

@SuppressWarnings("deprecation")
@Test(timeout = 30000)
public void testJobState() throws Exception {
 Job job_1 = getCopyJob();
 JobControl jc = new JobControl("Test");
 jc.addJob(job_1);
 Assert.assertEquals(Job.WAITING, job_1.getState());
 job_1.setState(Job.SUCCESS);
 Assert.assertEquals(Job.WAITING, job_1.getState());
 org.apache.hadoop.mapreduce.Job mockjob =
   mock(org.apache.hadoop.mapreduce.Job.class);
 org.apache.hadoop.mapreduce.JobID jid =
   new org.apache.hadoop.mapreduce.JobID("test", 0);
 when(mockjob.getJobID()).thenReturn(jid);
 job_1.setJob(mockjob);
 Assert.assertEquals("job_test_0000", job_1.getMapredJobID());
 job_1.setMapredJobID("job_test_0001");
 Assert.assertEquals("job_test_0000", job_1.getMapredJobID());
 jc.stop();
}

代码示例来源:origin: org.apache.pig/pig

if (job.getState() == Job.SUCCESS) {

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

@Test(timeout = 30000)
public void testAddingDependingJob() throws Exception {
 Job job_1 = getCopyJob();
 ArrayList<Job> dependingJobs = new ArrayList<Job>();
 JobControl jc = new JobControl("Test");
 jc.addJob(job_1);
 Assert.assertEquals(Job.WAITING, job_1.getState());
 Assert.assertTrue(job_1.addDependingJob(new Job(job_1.getJobConf(),
  dependingJobs)));
}

相关文章