YARN-7718. DistributedShell failed to specify resource other than memory/vcores from container_resources. Contributed by Wangda Tan.
This commit is contained in:
parent
b3290c41a9
commit
783a01eb4a
|
@ -1602,17 +1602,15 @@ public class ApplicationMaster {
|
|||
|
||||
Resource resourceCapability =
|
||||
Resource.newInstance(containerMemory, containerVirtualCores);
|
||||
if (resourceProfiles == null) {
|
||||
containerMemory = containerMemory == -1 ? DEFAULT_CONTAINER_MEMORY :
|
||||
containerMemory;
|
||||
containerVirtualCores =
|
||||
containerVirtualCores == -1 ? DEFAULT_CONTAINER_VCORES :
|
||||
containerVirtualCores;
|
||||
resourceCapability.setMemorySize(containerMemory);
|
||||
resourceCapability.setVirtualCores(containerVirtualCores);
|
||||
for (Map.Entry<String, Long> entry : containerResources.entrySet()) {
|
||||
resourceCapability.setResourceValue(entry.getKey(), entry.getValue());
|
||||
}
|
||||
containerMemory =
|
||||
containerMemory == -1 ? DEFAULT_CONTAINER_MEMORY : containerMemory;
|
||||
containerVirtualCores = containerVirtualCores == -1 ?
|
||||
DEFAULT_CONTAINER_VCORES :
|
||||
containerVirtualCores;
|
||||
resourceCapability.setMemorySize(containerMemory);
|
||||
resourceCapability.setVirtualCores(containerVirtualCores);
|
||||
for (Map.Entry<String, Long> entry : containerResources.entrySet()) {
|
||||
resourceCapability.setResourceValue(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
String profileName = containerResourceProfile;
|
||||
|
|
Loading…
Reference in New Issue