From af07edf1ab9024a78cb280e85982b1d6661a09ad Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 21 Feb 2013 11:36:26 +0000 Subject: [PATCH] Merge -r 1448596:1448597 from trunk to branch-2. Fixes: MAPREDUCE-4846. Some JobQueueInfo methods are public in MR1 but protected in MR2. Contributed by Sandy Ryza. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1448598 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../apache/hadoop/mapred/JobQueueInfo.java | 24 +++++++++++++------ .../mapred/QueueConfigurationParser.java | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index c3789f3458b..f88dade0cac 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -22,6 +22,9 @@ Release 2.0.4-beta - UNRELEASED MAPREDUCE-4994. Addendum fixing testcases failures. (sandyr via tucu) + MAPREDUCE-4846. Some JobQueueInfo methods are public in MR1 but protected + in MR2. (Sandy Ryza via tomwhite) + Release 2.0.3-alpha - 2013-02-06 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobQueueInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobQueueInfo.java index 3bfc7722deb..67b73cea71b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobQueueInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobQueueInfo.java @@ -67,7 +67,8 @@ public class JobQueueInfo extends QueueInfo { * * @param queueName Name of the job queue. */ - protected void setQueueName(String queueName) { + @InterfaceAudience.Private + public void setQueueName(String queueName) { super.setQueueName(queueName); } @@ -76,7 +77,8 @@ public class JobQueueInfo extends QueueInfo { * * @param schedulingInfo */ - protected void setSchedulingInfo(String schedulingInfo) { + @InterfaceAudience.Private + public void setSchedulingInfo(String schedulingInfo) { super.setSchedulingInfo(schedulingInfo); } @@ -84,15 +86,21 @@ public class JobQueueInfo extends QueueInfo { * Set the state of the queue * @param state state of the queue. */ - protected void setQueueState(String state) { + @InterfaceAudience.Private + public void setQueueState(String state) { super.setState(QueueState.getState(state)); } - String getQueueState() { + /** + * Use getState() instead + */ + @Deprecated + public String getQueueState() { return super.getState().toString(); } - protected void setChildren(List children) { + @InterfaceAudience.Private + public void setChildren(List children) { List list = new ArrayList(); for (JobQueueInfo q : children) { list.add(q); @@ -108,7 +116,8 @@ public class JobQueueInfo extends QueueInfo { return list; } - protected void setProperties(Properties props) { + @InterfaceAudience.Private + public void setProperties(Properties props) { super.setProperties(props); } @@ -141,7 +150,8 @@ public class JobQueueInfo extends QueueInfo { setChildren(children); } - protected void setJobStatuses(org.apache.hadoop.mapreduce.JobStatus[] stats) { + @InterfaceAudience.Private + public void setJobStatuses(org.apache.hadoop.mapreduce.JobStatus[] stats) { super.setJobStatuses(stats); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java index e0738d4c88d..3e608e00738 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/QueueConfigurationParser.java @@ -449,7 +449,7 @@ class QueueConfigurationParser { q.appendChild(propsElement); // Queue-state - String queueState = jqi.getQueueState(); + String queueState = jqi.getState().getStateName(); if (queueState != null && !queueState.equals(QueueState.UNDEFINED.getStateName())) { Element qStateElement = document.createElement(STATE_TAG);