YARN-2907. SchedulerNode#toString should print all resource detail instead of only memory. (Contributed by Rohith)

(cherry picked from commit c732ed760e)
This commit is contained in:
Junping Du 2014-12-01 05:38:22 -08:00
parent f4ab306347
commit c7bd22974a
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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();
}
/**

View File

@ -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.