/** * Create a job status object for a given jobid. * * @param jobid The jobid of the job * @param setupProgress The progress made on the setup * @param mapProgress The progress made on the maps * @param reduceProgress The progress made on the reduces * @param cleanupProgress The progress made on the cleanup * @param runState The current state of the job * @param jp Priority of the job. * @param user userid of the person who submitted the job. * @param jobName user-specified job name. * @param jobFile job configuration file. * @param trackingUrl link to the web-ui for details of the job. */ public JobStatus( JobID jobid, float setupProgress, float mapProgress, float reduceProgress, float cleanupProgress, int runState, JobPriority jp, String user, String jobName, String jobFile, String trackingUrl) { super( jobid, setupProgress, mapProgress, reduceProgress, cleanupProgress, getEnum(runState), org.apache.hadoop.mapreduce.JobPriority.valueOf(jp.name()), user, jobName, jobFile, trackingUrl); }
/** * Log job's priority. * * @param priority Jobs priority */ public void logJobPriority(JobID jobid, JobPriority priority) { if (disableHistory) { return; } if (null != writers) { log( writers, RecordTypes.Job, new Keys[] {Keys.JOBID, Keys.JOB_PRIORITY}, new String[] {jobId.toString(), priority.toString()}); } }
public static JobStatus downgrade(org.apache.hadoop.mapreduce.JobStatus stat) { JobStatus old = new JobStatus( JobID.downgrade(stat.getJobID()), stat.getSetupProgress(), stat.getMapProgress(), stat.getReduceProgress(), stat.getCleanupProgress(), stat.getState().getValue(), JobPriority.valueOf(stat.getPriority().name()), stat.getUsername(), stat.getJobName(), stat.getJobFile(), stat.getTrackingUrl()); old.setStartTime(stat.getStartTime()); old.setFinishTime(stat.getFinishTime()); old.setSchedulingInfo(stat.getSchedulingInfo()); old.setHistoryFile(stat.getHistoryFile()); return old; }
/** * Set the priority of the job, defaulting to NORMAL. * * @param jp new job priority */ public synchronized void setJobPriority(JobPriority jp) { super.setPriority(org.apache.hadoop.mapreduce.JobPriority.valueOf(jp.name())); }
/** * Return the priority of the job * * @return job priority */ public synchronized JobPriority getJobPriority() { return JobPriority.valueOf(super.getPriority().name()); }
/** * @param priority higher = better * @return */ public Params setPriority(JobPriority priority) { if (priority != null) { this.priority = priority.ordinal(); } return this; }
/** @param priority higher = better */ public Params(JobPriority priority) { if (priority != null) { this.priority = priority.ordinal(); } }