YARN-5588. [Partial backport] [YARN-3926] Add support for resource profiles in distributed shell. Contributed by Varun Vasudev.
(cherry picked from commit 7805deed4896e470ebd2f6bbd1ba9962947c63cd)
This commit is contained in:
parent
a9fa0349a0
commit
4045ef047d
@ -532,7 +532,7 @@ private void verifyMatches(
|
||||
List<? extends Collection<ContainerRequest>> matches,
|
||||
int matchSize) {
|
||||
assertEquals(1, matches.size());
|
||||
assertEquals(matches.get(0).size(), matchSize);
|
||||
assertEquals(matchSize, matches.get(0).size());
|
||||
}
|
||||
|
||||
@Test (timeout=60000)
|
||||
|
@ -219,9 +219,15 @@ public Resource getMaxAllowedAllocation() {
|
||||
return configuredMaxAllocation;
|
||||
}
|
||||
|
||||
return Resources.createResource(
|
||||
Math.min(configuredMaxAllocation.getMemorySize(), maxNodeMemory),
|
||||
Math.min(configuredMaxAllocation.getVirtualCores(), maxNodeVCores));
|
||||
Resource ret = Resources.clone(configuredMaxAllocation);
|
||||
if (ret.getMemorySize() > maxNodeMemory) {
|
||||
ret.setMemorySize(maxNodeMemory);
|
||||
}
|
||||
if (ret.getVirtualCores() > maxNodeVCores) {
|
||||
ret.setVirtualCores(maxNodeVCores);
|
||||
}
|
||||
|
||||
return ret;
|
||||
} finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user