protected RunningJob getJobInner(final JobID jobid) throws IOException { try { Job job = getJobUsingCluster(jobid); if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { return new NetworkedJob(status, cluster, new JobConf(job.getConfiguration())); } } } catch (InterruptedException ie) { throw new IOException(ie); } return null; }
protected RunningJob getJobInner(final JobID jobid) throws IOException { try { Job job = getJobUsingCluster(jobid); if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { return new NetworkedJob(status, cluster, new JobConf(job.getConfiguration())); } } } catch (InterruptedException ie) { throw new IOException(ie); } return null; }
protected RunningJob getJobInner(final JobID jobid) throws IOException { try { Job job = getJobUsingCluster(jobid); if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { return new NetworkedJob(status, cluster, new JobConf(job.getConfiguration())); } } } catch (InterruptedException ie) { throw new IOException(ie); } return null; }
return new NetworkedJob(status); } else { throw new IOException("Could not launch job");
return new NetworkedJob(status); } else { throw new IOException("Could not launch job");
@InterfaceAudience.Private public RunningJob submitJobInternal(final JobConf conf) throws FileNotFoundException, IOException { try { conf.setBooleanIfUnset("mapred.mapper.new-api", false); conf.setBooleanIfUnset("mapred.reducer.new-api", false); Job job = clientUgi.doAs(new PrivilegedExceptionAction<Job> () { @Override public Job run() throws IOException, ClassNotFoundException, InterruptedException { Job job = Job.getInstance(conf); job.submit(); return job; } }); Cluster prev = cluster; // update our Cluster instance with the one created by Job for submission // (we can't pass our Cluster instance to Job, since Job wraps the config // instance, and the two configs would then diverge) cluster = job.getCluster(); // It is important to close the previous cluster instance // to cleanup resources. if (prev != null) { prev.close(); } return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie); } }
@InterfaceAudience.Private public RunningJob submitJobInternal(final JobConf conf) throws FileNotFoundException, IOException { try { conf.setBooleanIfUnset("mapred.mapper.new-api", false); conf.setBooleanIfUnset("mapred.reducer.new-api", false); Job job = clientUgi.doAs(new PrivilegedExceptionAction<Job> () { @Override public Job run() throws IOException, ClassNotFoundException, InterruptedException { Job job = Job.getInstance(conf); job.submit(); return job; } }); Cluster prev = cluster; // update our Cluster instance with the one created by Job for submission // (we can't pass our Cluster instance to Job, since Job wraps the config // instance, and the two configs would then diverge) cluster = job.getCluster(); // It is important to close the previous cluster instance // to cleanup resources. if (prev != null) { prev.close(); } return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie); } }
@InterfaceAudience.Private public RunningJob submitJobInternal(final JobConf conf) throws FileNotFoundException, IOException { try { conf.setBooleanIfUnset("mapred.mapper.new-api", false); conf.setBooleanIfUnset("mapred.reducer.new-api", false); Job job = clientUgi.doAs(new PrivilegedExceptionAction<Job> () { @Override public Job run() throws IOException, ClassNotFoundException, InterruptedException { Job job = Job.getInstance(conf); job.submit(); return job; } }); Cluster prev = cluster; // update our Cluster instance with the one created by Job for submission // (we can't pass our Cluster instance to Job, since Job wraps the config // instance, and the two configs would then diverge) cluster = job.getCluster(); // It is important to close the previous cluster instance // to cleanup resources. if (prev != null) { prev.close(); } return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie); } }
@InterfaceAudience.Private public RunningJob submitJobInternal(final JobConf conf) throws FileNotFoundException, IOException { try { conf.setBooleanIfUnset("mapred.mapper.new-api", false); conf.setBooleanIfUnset("mapred.reducer.new-api", false); Job job = clientUgi.doAs(new PrivilegedExceptionAction<Job> () { @Override public Job run() throws IOException, ClassNotFoundException, InterruptedException { Job job = Job.getInstance(conf); job.submit(); return job; } }); Cluster prev = cluster; // update our Cluster instance with the one created by Job for submission // (we can't pass our Cluster instance to Job, since Job wraps the config // instance, and the two configs would then diverge) cluster = job.getCluster(); // It is important to close the previous cluster instance // to cleanup resources. if (prev != null) { prev.close(); } return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie); } }
/** * Submit a job to the MR system. * This returns a handle to the {@link RunningJob} which can be used to track * the running-job. * * @param conf the job configuration. * @return a handle to the {@link RunningJob} which can be used to track the * running-job. * @throws FileNotFoundException * @throws IOException */ public RunningJob submitJob(JobConf conf) throws FileNotFoundException, IOException { try { conf.setBooleanIfUnset("mapred.mapper.new-api", false); conf.setBooleanIfUnset("mapred.reducer.new-api", false); Job job = Job.getInstance(cluster, conf); job.submit(); return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie); } catch (ClassNotFoundException cnfe) { throw new IOException("class not found", cnfe); } }
/** * Get an {@link RunningJob} object to track an ongoing job. Returns * null if the id does not correspond to any known job. * * @param jobid the jobid of the job. * @return the {@link RunningJob} handle to track the job, null if the * <code>jobid</code> doesn't correspond to any known job. * @throws IOException */ public RunningJob getJob(JobID jobid) throws IOException { try { Job job = cluster.getJob(jobid); if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { return new NetworkedJob(status); } } } catch (InterruptedException ie) { throw new IOException(ie); } return null; }
/** * Get an {@link RunningJob} object to track an ongoing job. Returns * null if the id does not correspond to any known job. * * @param jobid the jobid of the job. * @return the {@link RunningJob} handle to track the job, null if the * <code>jobid</code> doesn't correspond to any known job. * @throws IOException */ public RunningJob getJob(JobID jobid) throws IOException { JobStatus status = jobSubmitClient.getJobStatus(jobid); if (status != null) { return new NetworkedJob(status); } else { return null; } }
/** * Get an {@link RunningJob} object to track an ongoing job. Returns * null if the id does not correspond to any known job. * * @param jobid the jobid of the job. * @return the {@link RunningJob} handle to track the job, null if the * <code>jobid</code> doesn't correspond to any known job. * @throws IOException */ public RunningJob getJob(JobID jobid) throws IOException { JobStatus status = jobSubmitClient.getJobStatus(jobid); if (status != null) { return new NetworkedJob(status); } else { return null; } }
protected RunningJob getJobInner(final JobID jobid) throws IOException { try { Job job = getJobUsingCluster(jobid); if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { return new NetworkedJob(status, cluster, new JobConf(job.getConfiguration())); } } } catch (InterruptedException ie) { throw new IOException(ie); } return null; }
@Test (timeout=5000) public void testGetNullCounters() throws Exception { //mock creation Job mockJob = mock(Job.class); RunningJob underTest = new JobClient.NetworkedJob(mockJob); when(mockJob.getCounters()).thenReturn(null); assertNull(underTest.getCounters()); //verification verify(mockJob).getCounters(); }