return new NetworkedJob(status); } else { throw new IOException("Could not launch job");
/** @deprecated This method is deprecated and will be removed. Applications should * rather use {@link #getID()}.*/ @Deprecated public String getJobID() { return getID().toString(); }
/** @deprecated Applications should rather use {@link #killTask(TaskAttemptID, boolean)}*/ @Deprecated public synchronized void killTask(String taskId, boolean shouldFail) throws IOException { killTask(TaskAttemptID.forName(taskId), shouldFail); }
JobID jobId = rj.getID(); NetworkedJob runningJob = (NetworkedJob) client.getJob(jobId); runningJob.setJobPriority(JobPriority.HIGH.name()); assertTrue(runningJob.getConfiguration().toString() .endsWith("0001/job.xml")); assertEquals(runningJob.getID(), jobId); assertEquals(runningJob.getJobID(), jobId.toString()); assertEquals(runningJob.getJobName(), "N/A"); assertTrue(runningJob.getJobFile().endsWith( ".staging/" + runningJob.getJobID() + "/job.xml")); assertTrue(runningJob.getTrackingURL().length() > 0); assertTrue(runningJob.mapProgress() == 0.0f); assertTrue(runningJob.reduceProgress() == 0.0f); assertTrue(runningJob.cleanupProgress() == 0.0f); assertTrue(runningJob.setupProgress() == 0.0f); TaskCompletionEvent[] tce = runningJob.getTaskCompletionEvents(0); assertEquals(tce.length, 0); assertEquals(runningJob.getHistoryUrl(),""); assertFalse(runningJob.isRetired()); assertEquals( runningJob.getFailureInfo(),""); assertEquals(runningJob.getJobStatus().getJobName(), "N/A"); assertEquals(client.getMapTaskReports(jobId).length, 0);
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; }
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; }
/** * Dump stats to screen */ @Override public String toString() { try { updateStatus(); } catch (IOException e) { } return "Job: " + profile.getJobID() + "\n" + "file: " + profile.getJobFile() + "\n" + "tracking URL: " + profile.getURL() + "\n" + "map() completion: " + status.mapProgress() + "\n" + "reduce() completion: " + status.reduceProgress(); }
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; }
/** * Dump stats to screen */ @Override public String toString() { try { updateStatus(); } catch (IOException e) { } return "Job: " + profile.getJobID() + "\n" + "file: " + profile.getJobFile() + "\n" + "tracking URL: " + profile.getURL() + "\n" + "map() completion: " + status.mapProgress() + "\n" + "reduce() completion: " + status.reduceProgress(); }
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; }
/** * Monitor a job and print status in real-time as progress is made and tasks * fail. * @param conf the job's configuration * @param job the job to track * @return true if the job succeeded * @throws IOException if communication to the JobTracker fails */ public boolean monitorAndPrintJob(JobConf conf, RunningJob job ) throws IOException, InterruptedException { return ((NetworkedJob)job).monitorAndPrintJob(); }