YARN-10193. FS-CS converter: fix incorrect capacity conversion. Contributed by Peter Bacsko

This commit is contained in:
Szilard Nemeth 2020-03-12 12:18:37 +01:00
parent 0fd8bf5f6b
commit 38d87883b6
2 changed files with 2 additions and 2 deletions

View File

@ -359,7 +359,7 @@ private Map<String, BigDecimal> getCapacities(int totalWeight,
// fix last value if total != 100.000
if (!totalPct.equals(hundred)) {
BigDecimal tmp = new BigDecimal(0);
for (int i = 0; i < children.size() - 2; i++) {
for (int i = 0; i < children.size() - 1; i++) {
tmp = tmp.add(capacities.get(children.get(i).getQueueName()));
}

View File

@ -296,7 +296,7 @@ public void testChildCapacity() {
csConfig.get(PREFIX + "root.default.capacity"));
assertEquals("root.admins capacity", "33.333",
csConfig.get(PREFIX + "root.admins.capacity"));
assertEquals("root.users capacity", "66.667",
assertEquals("root.users capacity", "33.334",
csConfig.get(PREFIX + "root.users.capacity"));
// root.users