YARN-6481. Yarn top shows negative container number in FS
(Contributed by Tao Jie via Daniel Templeton)
This commit is contained in:
parent
b062b323b7
commit
9f0aea0ee2
@ -253,6 +253,9 @@ public QueueStatistics getQueueStatistics() {
|
||||
stats.setAllocatedVCores(getMetrics().getAllocatedVirtualCores());
|
||||
stats.setPendingVCores(getMetrics().getPendingVirtualCores());
|
||||
stats.setReservedVCores(getMetrics().getReservedVirtualCores());
|
||||
stats.setAllocatedContainers(getMetrics().getAllocatedContainers());
|
||||
stats.setPendingContainers(getMetrics().getPendingContainers());
|
||||
stats.setReservedContainers(getMetrics().getReservedContainers());
|
||||
return stats;
|
||||
}
|
||||
|
||||
|
@ -874,6 +874,11 @@ public void testQueueInfo() throws IOException {
|
||||
QueueInfo queueInfo = scheduler.getQueueInfo("queueA", false, false);
|
||||
Assert.assertEquals(0.25f, queueInfo.getCapacity(), 0.0f);
|
||||
Assert.assertEquals(0.0f, queueInfo.getCurrentCapacity(), 0.0f);
|
||||
// test queueMetrics
|
||||
Assert.assertEquals(0, queueInfo.getQueueStatistics()
|
||||
.getAllocatedContainers());
|
||||
Assert.assertEquals(0, queueInfo.getQueueStatistics()
|
||||
.getAllocatedMemoryMB());
|
||||
queueInfo = scheduler.getQueueInfo("queueB", false, false);
|
||||
Assert.assertEquals(0.75f, queueInfo.getCapacity(), 0.0f);
|
||||
Assert.assertEquals(0.0f, queueInfo.getCurrentCapacity(), 0.0f);
|
||||
@ -889,9 +894,19 @@ public void testQueueInfo() throws IOException {
|
||||
queueInfo = scheduler.getQueueInfo("queueA", false, false);
|
||||
Assert.assertEquals(0.25f, queueInfo.getCapacity(), 0.0f);
|
||||
Assert.assertEquals(0.5f, queueInfo.getCurrentCapacity(), 0.0f);
|
||||
// test queueMetrics
|
||||
Assert.assertEquals(1, queueInfo.getQueueStatistics()
|
||||
.getAllocatedContainers());
|
||||
Assert.assertEquals(1024, queueInfo.getQueueStatistics()
|
||||
.getAllocatedMemoryMB());
|
||||
queueInfo = scheduler.getQueueInfo("queueB", false, false);
|
||||
Assert.assertEquals(0.75f, queueInfo.getCapacity(), 0.0f);
|
||||
Assert.assertEquals(1.0f, queueInfo.getCurrentCapacity(), 0.0f);
|
||||
// test queueMetrics
|
||||
Assert.assertEquals(1, queueInfo.getQueueStatistics()
|
||||
.getAllocatedContainers());
|
||||
Assert.assertEquals(6144, queueInfo.getQueueStatistics()
|
||||
.getAllocatedMemoryMB());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user