From 6ce32f593bff6788084ce9bc1e11ade74ed3dbaf Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Fri, 31 Oct 2014 15:32:21 -0700 Subject: [PATCH] YARN-2789. Re-instated the NodeReport.newInstance private unstable API modified in YARN-2698 so that tests in YARN frameworks don't break. Contributed by Wangda Tan. --- hadoop-yarn-project/CHANGES.txt | 4 ++++ .../org/apache/hadoop/yarn/api/records/NodeReport.java | 9 +++++++++ .../apache/hadoop/yarn/server/utils/BuilderUtils.java | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 6d7962971f..8816b299d7 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -822,6 +822,10 @@ Release 2.6.0 - UNRELEASED YARN-2698. Moved some node label APIs to be correctly placed in client protocol. (Wangda Tan via vinodkv) + YARN-2789. Re-instated the NodeReport.newInstance private unstable API + modified in YARN-2698 so that tests in YARN frameworks don't break. (Wangda + Tan via vinodkv) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java index df188f9c68..7ba866d1d1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java @@ -47,6 +47,15 @@ @Public @Stable public abstract class NodeReport { + + @Private + @Unstable + public static NodeReport newInstance(NodeId nodeId, NodeState nodeState, + String httpAddress, String rackName, Resource used, Resource capability, + int numContainers, String healthReport, long lastHealthReportTime) { + return newInstance(nodeId, nodeState, httpAddress, rackName, used, + capability, numContainers, healthReport, lastHealthReportTime, null); + } @Private @Unstable diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/utils/BuilderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/utils/BuilderUtils.java index ae5105d308..8f042a87aa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/utils/BuilderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/utils/BuilderUtils.java @@ -171,6 +171,13 @@ public static NodeId newNodeId(String host, int port) { return NodeId.newInstance(host, port); } + public static NodeReport newNodeReport(NodeId nodeId, NodeState nodeState, + String httpAddress, String rackName, Resource used, Resource capability, + int numContainers, String healthReport, long lastHealthReportTime) { + return newNodeReport(nodeId, nodeState, httpAddress, rackName, used, + capability, numContainers, healthReport, lastHealthReportTime, null); + } + public static NodeReport newNodeReport(NodeId nodeId, NodeState nodeState, String httpAddress, String rackName, Resource used, Resource capability, int numContainers, String healthReport, long lastHealthReportTime,