/** * Default constructor. Construct default JobControl instance. */ public GuaguaMapReduceClient() { this.jc = new JobControl(INIT_JOB_ID_PREFIX); }
/** * Default constructor. Construct default JobControl instance. */ public GuaguaMapReduceClient() { this.jc = new JobControl(INIT_JOB_ID_PREFIX); }
@Test public void testCircularDependency() throws IOException { ControlledJob job1 = new ControlledJob(new Configuration()); job1.setJobName("job1"); ControlledJob job2 = new ControlledJob(new Configuration()); job2.setJobName("job2"); ControlledJob job3 = new ControlledJob(new Configuration()); job3.setJobName("job3"); job1.addDependingJob(job2); job2.addDependingJob(job3); job3.addDependingJob(job1); JobControl jobControl = new JobControl("test"); jobControl.addJob(job1); jobControl.addJob(job2); jobControl.addJob(job3); try { jobControl.run(); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } } }
public static JobControl createValueAggregatorJobs(String args[], Class<? extends ValueAggregatorDescriptor>[] descriptors) throws IOException { JobControl theControl = new JobControl("ValueAggregatorJobs"); ArrayList<ControlledJob> dependingJobs = new ArrayList<ControlledJob>(); Configuration conf = new Configuration(); if (descriptors != null) { conf = setAggregatorDescriptors(descriptors); } Job job = createValueAggregatorJob(conf, args); ControlledJob cjob = new ControlledJob(job, dependingJobs); theControl.addJob(cjob); return theControl; }
public static JobControl createValueAggregatorJobs(String args[], Class<? extends ValueAggregatorDescriptor>[] descriptors) throws IOException { JobControl theControl = new JobControl("ValueAggregatorJobs"); ArrayList<ControlledJob> dependingJobs = new ArrayList<ControlledJob>(); Configuration conf = new Configuration(); if (descriptors != null) { conf = setAggregatorDescriptors(descriptors); } Job job = createValueAggregatorJob(conf, args); ControlledJob cjob = new ControlledJob(job, dependingJobs); theControl.addJob(cjob); return theControl; }
public static JobControl createValueAggregatorJobs(String args[], Class<? extends ValueAggregatorDescriptor>[] descriptors) throws IOException { JobControl theControl = new JobControl("ValueAggregatorJobs"); ArrayList<ControlledJob> dependingJobs = new ArrayList<ControlledJob>(); Configuration conf = new Configuration(); if (descriptors != null) { conf = setAggregatorDescriptors(descriptors); } Job job = createValueAggregatorJob(conf, args); ControlledJob cjob = new ControlledJob(job, dependingJobs); theControl.addJob(cjob); return theControl; }
public static JobControl createValueAggregatorJobs(String args[], Class<? extends ValueAggregatorDescriptor>[] descriptors) throws IOException { JobControl theControl = new JobControl("ValueAggregatorJobs"); ArrayList<ControlledJob> dependingJobs = new ArrayList<ControlledJob>(); Configuration conf = new Configuration(); if (descriptors != null) { conf = setAggregatorDescriptors(descriptors); } Job job = createValueAggregatorJob(conf, args); ControlledJob cjob = new ControlledJob(job, dependingJobs); theControl.addJob(cjob); return theControl; }
public static JobControl createValueAggregatorJobs(String args[], Class<? extends ValueAggregatorDescriptor>[] descriptors) throws IOException { JobControl theControl = new JobControl("ValueAggregatorJobs"); ArrayList<ControlledJob> dependingJobs = new ArrayList<ControlledJob>(); Configuration conf = new Configuration(); if (descriptors != null) { conf = setAggregatorDescriptors(descriptors); } Job job = createValueAggregatorJob(conf, args); ControlledJob cjob = new ControlledJob(job, dependingJobs); theControl.addJob(cjob); return theControl; }
public Double call() throws Exception JobControl jobControl = new JobControl("YDiff job");
public Double call() throws NectarException JobControl jobControl = new JobControl("sigmajob"); try
@Test public void testKillJob() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job = createFailedControlledJob(jobControl); job.killJob(); // Verify that killJob() was called on the mock Job verify(job.getJob()).killJob(); }
JobControl jobControl = new JobControl("job_chain");
cjob4 = new ControlledJob(job4, dependingJobs); JobControl theControl = new JobControl("Test"); theControl.addJob(cjob1); theControl.addJob(cjob2);
@Test public void testSuccessfulJobs() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job1 = createSuccessfulControlledJob(jobControl); ControlledJob job2 = createSuccessfulControlledJob(jobControl); ControlledJob job3 = createSuccessfulControlledJob(jobControl, job1, job2); ControlledJob job4 = createSuccessfulControlledJob(jobControl, job3); runJobControl(jobControl); assertEquals("Success list", 4, jobControl.getSuccessfulJobList().size()); assertEquals("Failed list", 0, jobControl.getFailedJobList().size()); assertTrue(job1.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job3.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job4.getJobState() == ControlledJob.State.SUCCESS); jobControl.stop(); }
@Test public void testFailedJob() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job1 = createFailedControlledJob(jobControl); ControlledJob job2 = createSuccessfulControlledJob(jobControl); ControlledJob job3 = createSuccessfulControlledJob(jobControl, job1, job2); ControlledJob job4 = createSuccessfulControlledJob(jobControl, job3); runJobControl(jobControl); assertEquals("Success list", 1, jobControl.getSuccessfulJobList().size()); assertEquals("Failed list", 3, jobControl.getFailedJobList().size()); assertTrue(job1.getJobState() == ControlledJob.State.FAILED); assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job3.getJobState() == ControlledJob.State.DEPENDENT_FAILED); assertTrue(job4.getJobState() == ControlledJob.State.DEPENDENT_FAILED); jobControl.stop(); }
@Test public void testKillJob() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job = createFailedControlledJob(jobControl); job.killJob(); // Verify that killJob() was called on the mock Job verify(job.getJob()).killJob(); }
@Test public void testErrorWhileSubmitting() throws Exception { JobControl jobControl = new JobControl("Test"); Job mockJob = mock(Job.class); ControlledJob job1 = new ControlledJob(mockJob, null); when(mockJob.getConfiguration()).thenReturn(new Configuration()); doThrow(new IncompatibleClassChangeError("This is a test")).when(mockJob).submit(); jobControl.addJob(job1); runJobControl(jobControl); try { assertEquals("Success list", 0, jobControl.getSuccessfulJobList().size()); assertEquals("Failed list", 1, jobControl.getFailedJobList().size()); assertTrue(job1.getJobState() == ControlledJob.State.FAILED); } finally { jobControl.stop(); } }
cjob4 = new ControlledJob(job4, dependingJobs); JobControl theControl = new JobControl("Test"); theControl.addJob(cjob1); theControl.addJob(cjob2);
@Test public void testSuccessfulJobs() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job1 = createSuccessfulControlledJob(jobControl); ControlledJob job2 = createSuccessfulControlledJob(jobControl); ControlledJob job3 = createSuccessfulControlledJob(jobControl, job1, job2); ControlledJob job4 = createSuccessfulControlledJob(jobControl, job3); runJobControl(jobControl); assertEquals("Success list", 4, jobControl.getSuccessfulJobList().size()); assertEquals("Failed list", 0, jobControl.getFailedJobList().size()); assertTrue(job1.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job3.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job4.getJobState() == ControlledJob.State.SUCCESS); jobControl.stop(); }
@Test public void testFailedJob() throws Exception { JobControl jobControl = new JobControl("Test"); ControlledJob job1 = createFailedControlledJob(jobControl); ControlledJob job2 = createSuccessfulControlledJob(jobControl); ControlledJob job3 = createSuccessfulControlledJob(jobControl, job1, job2); ControlledJob job4 = createSuccessfulControlledJob(jobControl, job3); runJobControl(jobControl); assertEquals("Success list", 1, jobControl.getSuccessfulJobList().size()); assertEquals("Failed list", 3, jobControl.getFailedJobList().size()); assertTrue(job1.getJobState() == ControlledJob.State.FAILED); assertTrue(job2.getJobState() == ControlledJob.State.SUCCESS); assertTrue(job3.getJobState() == ControlledJob.State.DEPENDENT_FAILED); assertTrue(job4.getJobState() == ControlledJob.State.DEPENDENT_FAILED); jobControl.stop(); }