本文整理了Java中org.apache.hadoop.mapred.jobcontrol.Job.getState()
方法的一些代码示例,展示了Job.getState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getState()
方法的具体详情如下:
包路径:org.apache.hadoop.mapred.jobcontrol.Job
类名称: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)));
}
内容来源于网络,如有侵权,请联系作者删除!