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

This commit is contained in:
Junping Du 2014-12-01 05:38:22 -08:00
parent 1556f86a31
commit c732ed760e
3 changed files with 13 additions and 3 deletions

View File

@ -101,6 +101,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 void reserveResource(SchedulerApplicationAttempt attempt,
@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 void testSchedulerRecovery() throws Exception {
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.