@Test public void testPopulateForHadoop2() { JobDetails jd = new JobDetails(null); NavigableMap<byte[], byte[]> infoValues = getInfoValues(HadoopVersion.TWO); Result result = Mockito.mock(Result.class); when(result.getFamilyMap(Constants.INFO_FAM_BYTES)).thenReturn(infoValues); jd.populate(result); confirmHadoopVersion(jd, HadoopVersion.TWO); confirmSomeJobDeets(jd); confirmHadoop2Counters(jd); }
public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.USER), infoValues); this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBNAME),infoValues); this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_PRIORITY), infoValues); this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_STATUS), infoValues); this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues); this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.SUBMIT_TIME), infoValues); this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.LAUNCH_TIME), infoValues); this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.FINISH_TIME), infoValues); this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.totalMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), infoValues); this.totalReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES), infoValues); this.finishedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS), infoValues); this.finishedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES), infoValues); this.failedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS), infoValues); this.failedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES), infoValues); this.config = JobHistoryService.parseConfiguration(infoValues); this.queue = this.config.get(Constants.HRAVEN_QUEUE); this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES, infoValues); if (this.hadoopVersion == HadoopVersion.TWO) { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2, Constants.REDUCE_SHUFFLE_BYTES); } else { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER, Constants.REDUCE_SHUFFLE_BYTES); } }
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.USER), infoValues); this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBNAME),infoValues); this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_PRIORITY), infoValues); this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_STATUS), infoValues); this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues); this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.SUBMIT_TIME), infoValues); this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.LAUNCH_TIME), infoValues); this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.FINISH_TIME), infoValues); this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.totalMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), infoValues); this.totalReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES), infoValues); this.finishedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS), infoValues); this.finishedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES), infoValues); this.failedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS), infoValues); this.failedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES), infoValues); this.config = JobHistoryService.parseConfiguration(infoValues); this.queue = this.config.get(Constants.HRAVEN_QUEUE); this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES, infoValues); if (this.hadoopVersion == HadoopVersion.TWO) { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2, Constants.REDUCE_SHUFFLE_BYTES); } else { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER, Constants.REDUCE_SHUFFLE_BYTES); } } }
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.USER), infoValues); this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBNAME),infoValues); this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_PRIORITY), infoValues); this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_STATUS), infoValues); this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues); this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.SUBMIT_TIME), infoValues); this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.LAUNCH_TIME), infoValues); this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.FINISH_TIME), infoValues); this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.totalMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), infoValues); this.totalReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES), infoValues); this.finishedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS), infoValues); this.finishedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES), infoValues); this.failedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS), infoValues); this.failedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES), infoValues); this.config = JobHistoryService.parseConfiguration(infoValues); this.queue = this.config.get(Constants.HRAVEN_QUEUE); this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES, infoValues); if (this.hadoopVersion == HadoopVersion.TWO) { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2, Constants.REDUCE_SHUFFLE_BYTES); } else { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER, Constants.REDUCE_SHUFFLE_BYTES); } } @JsonCreator  JobDetails(@JsonProperty("jobKey") JobKey key); }
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.USER), infoValues); this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBNAME),infoValues); this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_PRIORITY), infoValues); this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_STATUS), infoValues); this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues); this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.SUBMIT_TIME), infoValues); this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.LAUNCH_TIME), infoValues); this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.FINISH_TIME), infoValues); this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.totalMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), infoValues); this.totalReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES), infoValues); this.finishedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS), infoValues); this.finishedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES), infoValues); this.failedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS), infoValues); this.failedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES), infoValues); this.config = JobHistoryService.parseConfiguration(infoValues); this.queue = this.config.get(Constants.HRAVEN_QUEUE); this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES, infoValues); if (this.hadoopVersion == HadoopVersion.TWO) { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2, Constants.REDUCE_SHUFFLE_BYTES); } else { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER, Constants.REDUCE_SHUFFLE_BYTES); } } @JsonCreator  JobDetails(@JsonProperty("jobKey") JobKey key); @Override boolean equals(Object other); @Override int compareTo(JobDetails otherJob); @Override int hashCode(); JobKey getJobKey(); String getJobId(); void setJobId(String jobId); String getJobName(); void setJobName(String jobName); String getUser(); void setUser(String user); String getPriority(); void setPriority(String priority); String getStatus(); void setStatus(String status); String getVersion(); void setVersion(String version); HadoopVersion getHadoopVersion(); void setHadoopVersion(String hadoopVersion); long getSubmitTime(); void setSubmitTime(long submitTime); Date getSubmitDate(); long getLaunchTime(); void setLaunchTime(long launchTime); Date getLaunchDate(); long getFinishTime(); void setFinishTime(long finishTime); Date getFinishDate(); long getRunTime(); long getTotalMaps(); void setTotalMaps(long totalMaps); long getTotalReduces(); void setTotalReduces(long totalReduces); long getFinishedMaps(); void setFinishedMaps(long finishedMaps); long getFinishedReduces(); void setFinishedReduces(long finishedReduces); long getFailedMaps(); void setFailedMaps(long failedMaps); long getFailedReduces(); void setFailedReduces(long failedReduces); long getMapFileBytesRead(); void setMapFileBytesRead(long mapFileBytesRead); long getMapFileBytesWritten(); void setMapFileBytesWritten(long mapBytesWritten); long getHdfsBytesRead(); long getMapSlotMillis(); void setMapSlotMillis(long mapSlotMillis); long getReduceSlotMillis(); void setReduceSlotMillis(long reduceSlotMillis); long getReduceShuffleBytes(); void setReduceShuffleBytes(long reduceShuffleBytes); long getReduceFileBytesRead(); void setReduceFileBytesRead(long reduceFileBytesRead); long getHdfsBytesWritten(); void setHdfsBytesWritten(long hdfsBytesWritten); void setHdfsBytesRead(long hdfsBytesRead); long getMegabyteMillis(); void setMegabyteMillis(long megabyteMillis); double getCost(); void setCost(double cost); void addTask(TaskDetails task); void addTasks(List<TaskDetails> tasks); List<TaskDetails> getTasks(); String getQueue(); void setQueue(String queue); Configuration getConfiguration(); CounterMap getCounters(); CounterMap getMapCounters(); CounterMap getReduceCounters(); @Deprecated void setTasks(List<TaskDetails> newTasks); void populate(Result result); }
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.USER), infoValues); this.jobName = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBNAME),infoValues); this.priority = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_PRIORITY), infoValues); this.status = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOB_STATUS), infoValues); this.hadoopVersion = getHadoopVersionFromResult(JobHistoryKeys.hadoopversion, infoValues); this.version = ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.submitTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.SUBMIT_TIME), infoValues); this.launchTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.LAUNCH_TIME), infoValues); this.finishTime = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.FINISH_TIME), infoValues); this.megabyteMillis = ByteUtil.getValueAsLong(Constants.MEGABYTEMILLIS_BYTES, infoValues); this.cost = ByteUtil.getValueAsDouble(Constants.JOBCOST_BYTES, infoValues); this.totalMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), infoValues); this.totalReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_REDUCES), infoValues); this.finishedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_MAPS), infoValues); this.finishedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FINISHED_REDUCES), infoValues); this.failedMaps = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_MAPS), infoValues); this.failedReduces = ByteUtil.getValueAsLong(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.FAILED_REDUCES), infoValues); this.config = JobHistoryService.parseConfiguration(infoValues); this.queue = this.config.get(Constants.HRAVEN_QUEUE); this.counters = JobHistoryService.parseCounters(Constants.COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.mapCounters = JobHistoryService.parseCounters(Constants.MAP_COUNTER_COLUMN_PREFIX_BYTES, infoValues); this.reduceCounters = JobHistoryService.parseCounters(Constants.REDUCE_COUNTER_COLUMN_PREFIX_BYTES, infoValues); if (this.hadoopVersion == HadoopVersion.TWO) { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTER_HADOOP2, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOB_COUNTER_HADOOP2, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER_HADOOP2, Constants.REDUCE_SHUFFLE_BYTES); } else { this.mapFileBytesRead = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.mapFileBytesWritten = getCounterValueAsLong(this.mapCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_WRITTEN); this.reduceFileBytesRead = getCounterValueAsLong(this.reduceCounters, Constants.FILESYSTEM_COUNTERS, Constants.FILES_BYTES_READ); this.hdfsBytesRead = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_READ); this.hdfsBytesWritten = getCounterValueAsLong(this.counters, Constants.FILESYSTEM_COUNTERS, Constants.HDFS_BYTES_WRITTEN); this.mapSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_MAPS); this.reduceSlotMillis = getCounterValueAsLong(this.counters, Constants.JOBINPROGRESS_COUNTER, Constants.SLOTS_MILLIS_REDUCES); this.reduceShuffleBytes = getCounterValueAsLong(this.reduceCounters, Constants.TASK_COUNTER, Constants.REDUCE_SHUFFLE_BYTES); } } @JsonCreator  JobDetails(@JsonProperty("jobKey") JobKey key); @Override boolean equals(Object other); @Override int compareTo(JobDetails otherJob); @Override int hashCode(); JobKey getJobKey(); String getJobId(); void setJobId(String jobId); String getJobName(); void setJobName(String jobName); String getUser(); void setUser(String user); String getPriority(); void setPriority(String priority); String getStatus(); void setStatus(String status); String getVersion(); void setVersion(String version); HadoopVersion getHadoopVersion(); void setHadoopVersion(String hadoopVersion); long getSubmitTime(); void setSubmitTime(long submitTime); Date getSubmitDate(); long getLaunchTime(); void setLaunchTime(long launchTime); Date getLaunchDate(); long getFinishTime(); void setFinishTime(long finishTime); Date getFinishDate(); long getRunTime(); long getTotalMaps(); void setTotalMaps(long totalMaps); long getTotalReduces(); void setTotalReduces(long totalReduces); long getFinishedMaps(); void setFinishedMaps(long finishedMaps); long getFinishedReduces(); void setFinishedReduces(long finishedReduces); long getFailedMaps(); void setFailedMaps(long failedMaps); long getFailedReduces(); void setFailedReduces(long failedReduces); long getMapFileBytesRead(); void setMapFileBytesRead(long mapFileBytesRead); long getMapFileBytesWritten(); void setMapFileBytesWritten(long mapBytesWritten); long getHdfsBytesRead(); long getMapSlotMillis(); void setMapSlotMillis(long mapSlotMillis); long getReduceSlotMillis(); void setReduceSlotMillis(long reduceSlotMillis); long getReduceShuffleBytes(); void setReduceShuffleBytes(long reduceShuffleBytes); long getReduceFileBytesRead(); void setReduceFileBytesRead(long reduceFileBytesRead); long getHdfsBytesWritten(); void setHdfsBytesWritten(long hdfsBytesWritten); void setHdfsBytesRead(long hdfsBytesRead); long getMegabyteMillis(); void setMegabyteMillis(long megabyteMillis); double getCost(); void setCost(double cost); void addTask(TaskDetails task); void addTasks(List<TaskDetails> tasks); List<TaskDetails> getTasks(); String getQueue(); void setQueue(String queue); Configuration getConfiguration(); CounterMap getCounters(); CounterMap getMapCounters(); CounterMap getReduceCounters(); @Deprecated void setTasks(List<TaskDetails> newTasks); void populate(Result result);  }