From 228ddaa31d812533b862576445494bc2cd8a2884 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Fri, 14 Jul 2017 08:07:05 +0530 Subject: [PATCH] YARN-6792. Incorrect XML convertion in NodeIDsInfo and LabelsToNodesInfo. Contributed by Giovanni Matteo Fumarola. --- .../yarn/server/resourcemanager/webapp/NodeIDsInfo.java | 5 ++++- .../resourcemanager/webapp/dao/LabelsToNodesInfo.java | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodeIDsInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodeIDsInfo.java index c23b02ac07..5f45b9622d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodeIDsInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodeIDsInfo.java @@ -26,7 +26,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -@XmlRootElement(name = "labelsToNodesInfo") +/** + * XML element uses to represent NodeIds' list. + */ +@XmlRootElement(name = "nodeIDsInfo") @XmlAccessorType(XmlAccessType.FIELD) public class NodeIDsInfo { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/LabelsToNodesInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/LabelsToNodesInfo.java index 41dd410d33..e842d42450 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/LabelsToNodesInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/LabelsToNodesInfo.java @@ -37,7 +37,11 @@ public class LabelsToNodesInfo { public LabelsToNodesInfo() { } // JAXB needs this + public LabelsToNodesInfo(Map labelsToNodes) { + this.labelsToNodes = labelsToNodes; + } + public Map getLabelsToNodes() { - return labelsToNodes; + return labelsToNodes; } } \ No newline at end of file