diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 88e14eca987..3482f0f9875 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -53,6 +53,9 @@ Release 2.4.1 - UNRELEASED MAPREDUCE-5824. Fixed test-failure of TestPipesNonJavaInputFormat in Windows. (Xuan Gong via vinodkv) + MAPREDUCE-5815. Fixed test-failure of TestMRAppMaster by making MRAppMaster + gracefully handle empty-queue names. (Akira Ajisaka via vinodkv) + Release 2.4.0 - 2014-04-07 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java index f053e9600a3..8fd7b471600 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java @@ -40,6 +40,7 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; +import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.Counter; import org.apache.hadoop.mapreduce.Counters; import org.apache.hadoop.mapreduce.JobCounter; @@ -442,8 +443,13 @@ public class JobHistoryEventHandler extends AbstractService } } + String queueName = JobConf.DEFAULT_QUEUE_NAME; + if (conf != null) { + queueName = conf.get(MRJobConfig.QUEUE_NAME, JobConf.DEFAULT_QUEUE_NAME); + } + MetaInfo fi = new MetaInfo(historyFile, logDirConfPath, writer, - user, jobName, jobId, forcedJobStateOnShutDown); + user, jobName, jobId, forcedJobStateOnShutDown, queueName); fi.getJobSummary().setJobId(jobId); fileMap.put(jobId, fi); } @@ -816,12 +822,14 @@ public class JobHistoryEventHandler extends AbstractService private String forcedJobStateOnShutDown; MetaInfo(Path historyFile, Path conf, EventWriter writer, String user, - String jobName, JobId jobId, String forcedJobStateOnShutDown) { + String jobName, JobId jobId, String forcedJobStateOnShutDown, + String queueName) { this.historyFile = historyFile; this.confFile = conf; this.writer = writer; this.jobIndexInfo = - new JobIndexInfo(-1, -1, user, jobName, jobId, -1, -1, null); + new JobIndexInfo(-1, -1, user, jobName, jobId, -1, -1, null, + queueName); this.jobSummary = new JobSummary(); this.flushTimer = new Timer("FlushTimer", true); this.forcedJobStateOnShutDown = forcedJobStateOnShutDown; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/FileNameIndexUtils.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/FileNameIndexUtils.java index 821a93d4bf1..54bbcd93c52 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/FileNameIndexUtils.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/FileNameIndexUtils.java @@ -94,7 +94,7 @@ public class FileNameIndexUtils { sb.append(DELIMITER); //QueueName - sb.append(escapeDelimiters(indexInfo.getQueueName())); + sb.append(escapeDelimiters(getQueueName(indexInfo))); sb.append(DELIMITER); //JobStartTime @@ -262,6 +262,10 @@ public class FileNameIndexUtils { return getNonEmptyString(indexInfo.getJobName()); } + private static String getQueueName(JobIndexInfo indexInfo) { + return getNonEmptyString(indexInfo.getQueueName()); + } + //TODO Maybe handle default values for longs and integers here? private static String getNonEmptyString(String in) { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobIndexInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobIndexInfo.java index 5c6189eea45..ef10294a5ac 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobIndexInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/jobhistory/JobIndexInfo.java @@ -18,10 +18,11 @@ package org.apache.hadoop.mapreduce.v2.jobhistory; +import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.v2.api.records.JobId; /** - * Maintains information which may be used by the jobHistroy indexing + * Maintains information which may be used by the jobHistory indexing * system. */ public class JobIndexInfo { @@ -41,6 +42,13 @@ public class JobIndexInfo { public JobIndexInfo(long submitTime, long finishTime, String user, String jobName, JobId jobId, int numMaps, int numReduces, String jobStatus) { + this(submitTime, finishTime, user, jobName, jobId, numMaps, numReduces, + jobStatus, JobConf.DEFAULT_QUEUE_NAME); + } + + public JobIndexInfo(long submitTime, long finishTime, String user, + String jobName, JobId jobId, int numMaps, int numReduces, + String jobStatus, String queueName) { this.submitTime = submitTime; this.finishTime = finishTime; this.user = user; @@ -50,8 +58,9 @@ public class JobIndexInfo { this.numReduces = numReduces; this.jobStatus = jobStatus; this.jobStartTime = -1; + this.queueName = queueName; } - + public long getSubmitTime() { return submitTime; }