public SchedulerNodeReport(SchedulerNode node) { this.used = node.getAllocatedResource(); this.avail = node.getUnallocatedResource(); this.num = node.getNumContainers(); }
@Override public int compare(N o1, N o2) { int allocatedDiff = o1.getAllocatedResource() .compareTo(o2.getAllocatedResource()); if (allocatedDiff == 0) { return o1.getNodeID().compareTo(o2.getNodeID()); } return allocatedDiff; } };
@Override public String toString() { return "host: " + rmNode.getNodeAddress() + " #containers=" + getNumContainers() + " available=" + getUnallocatedResource() + " used=" + getAllocatedResource(); }
+ container.getResource() + " on host " + rmNode.getNodeAddress() + ", which currently has " + numContainers + " containers, " + getAllocatedResource() + " used and " + getUnallocatedResource() + " available" + ", release resources=" + true);
.handle( new RMNodeResourceUpdateEvent(nm.getNodeID(), ResourceOption .newInstance(schedulerNode.getAllocatedResource(), 0)));
.getSchedulerNode(nm_0.getNodeId()).getAllocatedResource(); Assert.assertEquals(usedResource.getMemorySize(), 0); Assert.assertEquals(usedResource.getVirtualCores(), 0);
.getSchedulerNode(nm_0.getNodeId()).getAllocatedResource(); Assert.assertEquals(usedResource.getMemorySize(), 1 * GB); Assert.assertEquals(usedResource.getVirtualCores(), 1);
Resource usedResource = resourceManager.getResourceScheduler() .getSchedulerNode(nm_0.getNodeId()).getAllocatedResource(); Assert.assertEquals("Used Resource Memory Size should be 1GB", 1 * GB, usedResource.getMemorySize());
"SchedulerNode#toString is not in expected format", schedulerNode1 .toString().contains(schedulerNode1.getAllocatedResource().toString())); assertEquals(usedResources, schedulerNode1.getAllocatedResource()); Resource availableResources = Resources.subtract(nmResource, usedResources);
assertEquals(usedResources, schedulerNode1.getAllocatedResource());
assertEquals(usedResources, schedulerNode1.getAllocatedResource()); Resource availableResources = Resources.subtract(nmResource, usedResources);
rm.getRMContext().getScheduler().getSchedulerNode(nodeId); Assert.assertNotNull(schedulerNode); Resource nodeResources = schedulerNode.getAllocatedResource(); Assert.assertEquals(Resource.newInstance(2048, 1), nodeResources);