private JobInProgress createAndAddJob(JobTracker jobtracker, JobConf conf) { // submit a job in a fake manner // get the new job-id JobID id = new JobID(jobtracker.getTrackerIdentifier(), jobtracker.jobs.size() + 1); // create a JobInProgress for this fake job JobInProgress jip = new JobInProgress(id, conf, jobtracker); // insert this fake completed job in the jobtracker jobtracker.jobs.put(id, jip); return jip; }
/** * JobTracker.submitJob() kicks off a new job. * * Create a 'JobInProgress' object, which contains both JobProfile * and JobStatus. Those two sub-objects are sometimes shipped outside * of the JobTracker. But JobInProgress adds info that's useful for * the JobTracker alone. */ public synchronized JobStatus submitJob(JobID jobId) throws IOException { if(jobs.containsKey(jobId)) { //job already running, don't start twice return jobs.get(jobId).getStatus(); } JobInProgress job = new JobInProgress(jobId, this, this.conf); // check for access checkAccess(job, QueueManager.QueueOperation.SUBMIT_JOB); return addJob(jobId, job); }
new JobInProgress(this, this.conf, restartCount, jobInfo, ts);
for (JobID id : jobsToRecover) { JobInProgress job = new JobInProgress(id, JobTracker.this, conf);
JobInProgress job = null; try { job = new JobInProgress(jobId, this, jobTrackerReconfigurable.getJobConf(), ugi.getUserName(), 0); } catch (Exception e) {
static void runTest(int maxTasks, int numMaps, int numReds, boolean shouldFail) throws Exception { JobConf conf = new JobConf(); conf.setInt(JTConfig.JT_TASKS_PER_JOB, maxTasks); conf.set(JTConfig.JT_IPC_HANDLER_COUNT, "1"); MiniMRCluster mr = new MiniMRCluster(0, "file:///", 1, null, null, conf); JobTracker jt = mr.getJobTrackerRunner().getJobTracker(); JobConf jc = mr.createJobConf(); jc.setNumMapTasks(numMaps); jc.setNumReduceTasks(numReds); JobInProgress jip = new JobInProgress(new JobID(), jc, jt); boolean failed = false; try { jip.checkTaskLimits(); } catch (IOException e) { failed = true; } assertEquals(shouldFail, failed); mr.shutdown(); }
jc.setNumReduceTasks(reduces); JobInProgress jip = new JobInProgress(jid, jc, UtilsForTests.getJobTracker());
jc.setNumReduceTasks(reduces); JobInProgress jip = new JobInProgress(jid, jc, UtilsForTests.getJobTracker()) { long getInputLength() {