diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index ded5c2367af..f9ec5eda4b5 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -74,6 +74,9 @@ Release 2.7.0 - UNRELEASED YARN-2165. Added the sanity check for the numeric configuration values of the timeline service. (Vasanth kumar RJ via zjshen) + YARN-2907. SchedulerNode#toString should print all resource detail instead + of only memory. (Rohith via junping_du) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerNode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerNode.java index f4d8731a012..b115fc896a2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerNode.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerNode.java @@ -242,9 +242,8 @@ public abstract class SchedulerNode { @Override public String toString() { return "host: " + rmNode.getNodeAddress() + " #containers=" - + getNumContainers() + " available=" - + getAvailableResource().getMemory() + " used=" - + getUsedResource().getMemory(); + + getNumContainers() + " available=" + getAvailableResource() + + " used=" + getUsedResource(); } /** diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java index 1cefcf851fb..853e0a57e0b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestWorkPreservingRMRestart.java @@ -214,6 +214,14 @@ public class TestWorkPreservingRMRestart { AbstractYarnScheduler scheduler = (AbstractYarnScheduler) rm2.getResourceScheduler(); SchedulerNode schedulerNode1 = scheduler.getSchedulerNode(nm1.getNodeId()); + assertTrue( + "SchedulerNode#toString is not in expected format", + schedulerNode1 + .toString().contains(schedulerNode1.getAvailableResource().toString())); + assertTrue( + "SchedulerNode#toString is not in expected format", + schedulerNode1 + .toString().contains(schedulerNode1.getUsedResource().toString())); // ********* check scheduler node state.******* // 2 running containers.