Browse Source

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.

Vinod Kumar Vavilapalli 10 years ago
parent
commit
6ce32f593b

+ 4 - 0
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
     YARN-2698. Moved some node label APIs to be correctly placed in client
     protocol. (Wangda Tan via vinodkv)
     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
 Release 2.5.1 - 2014-09-05
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 9 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeReport.java

@@ -47,6 +47,15 @@ import org.apache.hadoop.yarn.util.Records;
 @Public
 @Public
 @Stable
 @Stable
 public abstract class NodeReport {
 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
   @Private
   @Unstable
   @Unstable

+ 7 - 0
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 class BuilderUtils {
     return NodeId.newInstance(host, 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,
   public static NodeReport newNodeReport(NodeId nodeId, NodeState nodeState,
       String httpAddress, String rackName, Resource used, Resource capability,
       String httpAddress, String rackName, Resource used, Resource capability,
       int numContainers, String healthReport, long lastHealthReportTime,
       int numContainers, String healthReport, long lastHealthReportTime,