diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index c3f2dd0cd0..ea550b874b 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1821,6 +1821,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3284. Moved JobQueueClient to hadoop-mapreduce-client-core. (acmurthy) + MAPREDUCE-3282. bin/mapred job -list throws exception. (acmurthy via + mahadev) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java index 2e7a58784a..a938213073 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/TypeConverter.java @@ -380,6 +380,7 @@ public static List fromYarn( public static JobStatus.State fromYarn(YarnApplicationState state) { switch (state) { + case NEW: case SUBMITTED: return State.PREP; case RUNNING: diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/TestTypeConverter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/TestTypeConverter.java index 03f0d2a215..9bbd070768 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/TestTypeConverter.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/TestTypeConverter.java @@ -20,6 +20,9 @@ import junit.framework.Assert; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.mapreduce.v2.api.records.JobState; +import org.apache.hadoop.mapreduce.v2.api.records.TaskState; +import org.apache.hadoop.mapreduce.v2.api.records.TaskType; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.api.records.ApplicationReport; @@ -28,12 +31,38 @@ import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationResourceUsageReportPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.QueueInfoPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl; +import org.apache.hadoop.yarn.api.records.QueueState; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.junit.Test; public class TestTypeConverter { + @Test + public void testEnums() throws Exception { + for (YarnApplicationState applicationState : YarnApplicationState.values()) { + TypeConverter.fromYarn(applicationState); + } + + for (TaskType taskType : TaskType.values()) { + TypeConverter.fromYarn(taskType); + } + + for (JobState jobState : JobState.values()) { + TypeConverter.fromYarn(jobState); + } + + for (QueueState queueState : QueueState.values()) { + TypeConverter.fromYarn(queueState); + } + + for (TaskState taskState : TaskState.values()) { + TypeConverter.fromYarn(taskState); + } + + + } + @Test public void testFromYarn() throws Exception { int appStartTime = 612354;