YARN-11646. Do not ignore zero memory capacity config in QueueCapacityConfigParser. (#6433)
This commit is contained in:
parent
bc159b5a87
commit
55b9f87698
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src
main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/conf
test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/conf
@ -148,11 +148,6 @@ public class QueueCapacityConfigParser {
|
||||
}
|
||||
}
|
||||
|
||||
// Memory always have to be defined
|
||||
if (capacityVector.getMemory() == 0L) {
|
||||
return new QueueCapacityVector();
|
||||
}
|
||||
|
||||
return capacityVector;
|
||||
}
|
||||
|
||||
|
@ -214,4 +214,19 @@ public class TestQueueCapacityConfigParser {
|
||||
Lists.newArrayList(nonSetCapacity.iterator());
|
||||
Assert.assertEquals(nonSetResources.size(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZeroAbsoluteCapacityConfig() {
|
||||
QueueCapacityVector weightCapacityVector =
|
||||
capacityConfigParser.parse(String.format(MEMORY_VCORE_TEMPLATE, 0, 0), QUEUE);
|
||||
|
||||
QueueCapacityVectorEntry memory = weightCapacityVector.getResource(MEMORY_URI);
|
||||
QueueCapacityVectorEntry vcore = weightCapacityVector.getResource(VCORES_URI);
|
||||
|
||||
Assert.assertEquals(ResourceUnitCapacityType.ABSOLUTE, memory.getVectorResourceType());
|
||||
Assert.assertEquals(0, memory.getResourceValue(), EPSILON);
|
||||
|
||||
Assert.assertEquals(ResourceUnitCapacityType.ABSOLUTE, vcore.getVectorResourceType());
|
||||
Assert.assertEquals(0, vcore.getResourceValue(), EPSILON);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user