YARN-5588. [Partial backport] [YARN-3926] Add support for resource profiles in distributed shell. Contributed by Varun Vasudev.
(cherry picked from commit 7805deed48
)
This commit is contained in:
parent
6db8c36ba9
commit
c5e77e8b84
|
@ -546,7 +546,7 @@ public class TestAMRMClient {
|
|||
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)
|
||||
|
|
|
@ -220,9 +220,15 @@ public class ClusterNodeTracker<N extends SchedulerNode> {
|
|||
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…
Reference in New Issue