/** * @return the mapred job conf of this job */ public synchronized JobConf getJobConf() { return new JobConf(super.getJob().getConfiguration()); }
public String toFakedStateString(ControlledJob controlledJob) { StringBuffer sb = new StringBuffer(); sb.append("job name:\t").append(controlledJob.getJob().getJobName()).append("\n"); sb.append("job id:\t").append(controlledJob.getJobID()).append("\n"); sb.append("job state:\t").append("SUCCESS").append("\n"); sb.append("job mapred id:\t").append(controlledJob.getJob().getJobID()).append("\n"); sb.append("job message:\t").append(" successful job").append("\n"); sb.append("job has no depending job:\t").append("\n"); return sb.toString(); }
/** * Returns the progress of a Job j which is part of a submitted JobControl object. The progress is for this Job. So * it has to be scaled down by the number of jobs that are present in the JobControl. * * @param cjob * - The Job for which progress is required * @param jobClient * - the JobClient to which it has been submitted * @return Returns the percentage progress of this Job * @throws IOException * In case any IOException connecting to JobTracker. */ protected double progressOfRunningJob(ControlledJob cjob, JobClient jobClient) throws IOException { @SuppressWarnings("deprecation") RunningJob rj = jobClient.getJob(cjob.getJob().getJobID().toString()); if(rj == null && cjob.getJobState() == ControlledJob.State.SUCCESS) return 1; else if(rj == null) return 0; else { return rj.mapProgress(); } }
/** * @return the mapred job conf of this job */ public synchronized JobConf getJobConf() { return new JobConf(super.getJob().getConfiguration()); }
/** * Returns the progress of a Job j which is part of a submitted JobControl object. The progress is for this Job. So * it has to be scaled down by the number of jobs that are present in the JobControl. * * @param cjob * - The Job for which progress is required * @param jobClient * - the JobClient to which it has been submitted * @return Returns the percentage progress of this Job * @throws IOException * In case any IOException connecting to JobTracker. */ protected double progressOfRunningJob(ControlledJob cjob, JobClient jobClient) throws IOException { @SuppressWarnings("deprecation") RunningJob rj = jobClient.getJob(cjob.getJob().getJobID().toString()); if(rj == null && cjob.getJobState() == ControlledJob.State.SUCCESS) return 1; else if(rj == null) return 0; else { return rj.mapProgress(); } }
public String toFakedStateString(ControlledJob controlledJob) { StringBuffer sb = new StringBuffer(); sb.append("job name:\t").append(controlledJob.getJob().getJobName()).append("\n"); sb.append("job id:\t").append(controlledJob.getJobID()).append("\n"); sb.append("job state:\t").append("SUCCESS").append("\n"); sb.append("job mapred id:\t").append(controlledJob.getJob().getJobID()).append("\n"); sb.append("job message:\t").append(" successful job").append("\n"); sb.append("job has no depending job:\t").append("\n"); return sb.toString(); }
/** * @return the mapred job conf of this job */ public synchronized JobConf getJobConf() { return new JobConf(super.getJob().getConfiguration()); }
/** * @return the mapred job conf of this job */ public synchronized JobConf getJobConf() { return new JobConf(super.getJob().getConfiguration()); }
/** * @return the mapred job conf of this job */ public synchronized JobConf getJobConf() { return new JobConf(super.getJob().getConfiguration()); }
/** * @return the job client of this job */ public JobClient getJobClient() { try { return new JobClient(super.getJob().getConfiguration()); } catch (IOException ioe) { return null; } }
/** * @return the job client of this job */ public JobClient getJobClient() { try { return new JobClient(super.getJob().getConfiguration()); } catch (IOException ioe) { return null; } }
/** * @return the job client of this job */ public JobClient getJobClient() { try { return new JobClient(super.getJob().getConfiguration()); } catch (IOException ioe) { return null; } }
/** * @return the job client of this job */ public JobClient getJobClient() { try { return new JobClient(super.getJob().getConfiguration()); } catch (IOException ioe) { return null; } }
/** * @return the job client of this job */ public JobClient getJobClient() { try { return new JobClient(super.getJob().getConfiguration()); } catch (IOException ioe) { return null; } }
@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(); }
if(job.getJob().getJobID() != null) { jobsAssignedIdInThisRun.add(job); LOG.info("Job {} is started.", job.getJob().getJobID().toString()); } else { String jobId = controlledJob.getJob().getJobID().toString(); Counters counters = getCounters(controlledJob.getJob()); Counter doneMaster = counters.findCounter(GuaguaMapReduceConstants.GUAGUA_STATUS, GuaguaMapReduceConstants.MASTER_SUCCESS); if(System.currentTimeMillis() - initTime >= 2 * 60 * 1000L) { killedSuccessJobSet.add(jobId); killJob(controlledJob.getJob().getConfiguration(), jobId, "Kill job " + jobId + " because of master is already finished, job " + jobId + " is treated as successful as we got models. "); String jobId = controlledJob.getJob().getJobID().toString(); if(!finalSucessfulJobIDs.contains(jobId)) { LOG.info("Job {} is successful.", jobId); String failedJobId = controlledJob.getJob().getJobID().toString(); if(killedSuccessJobSet.contains(failedJobId)) { if(!finalSucessfulJobIDs.contains(failedJobId)) { String jobName = controlledJob.getJob().getJobName(); Integer jobIndex = this.jobIndexMap.get(jobName); Integer runTimes = this.jobRunningTimes.get(jobIndex); if(finalSucessfulJobIDs.contains(controlledJob.getJob().getJobID().toString())) {
if(job.getJob().getJobID() != null) { jobsAssignedIdInThisRun.add(job); LOG.info("Job {} is started.", job.getJob().getJobID().toString()); } else { String jobId = controlledJob.getJob().getJobID().toString(); Counters counters = getCounters(controlledJob.getJob()); Counter doneMaster = counters.findCounter(GuaguaMapReduceConstants.GUAGUA_STATUS, GuaguaMapReduceConstants.MASTER_SUCCESS); if(System.currentTimeMillis() - initTime >= 2 * 60 * 1000L) { killedSuccessJobSet.add(jobId); killJob(controlledJob.getJob().getConfiguration(), jobId, "Kill job " + jobId + " because of master is already finished, job " + jobId + " is treated as successful as we got models. "); String jobId = controlledJob.getJob().getJobID().toString(); if(!finalSucessfulJobIDs.contains(jobId)) { LOG.info("Job {} is successful.", jobId); String failedJobId = controlledJob.getJob().getJobID().toString(); if(killedSuccessJobSet.contains(failedJobId)) { if(!finalSucessfulJobIDs.contains(failedJobId)) { String jobName = controlledJob.getJob().getJobName(); Integer jobIndex = this.jobIndexMap.get(jobName); Integer runTimes = this.jobRunningTimes.get(jobIndex); if(finalSucessfulJobIDs.contains(controlledJob.getJob().getJobID().toString())) {
@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(); }