YARN-10701. The yarn.resource-types should support multi types without trimmed. Contributed by Qi Zhu.

This commit is contained in:
zhuqi-lucas 2021-05-19 21:24:26 +08:00
parent a45d6437f5
commit 7d2eeaecc8
2 changed files with 4 additions and 3 deletions

View File

@ -251,7 +251,8 @@ public static Resource fetchMaximumAllocationFromConfig(Configuration conf) {
private static Map<String, ResourceInformation> getResourceInformationMapFromConfig( private static Map<String, ResourceInformation> getResourceInformationMapFromConfig(
Configuration conf) { Configuration conf) {
Map<String, ResourceInformation> resourceInformationMap = new HashMap<>(); Map<String, ResourceInformation> resourceInformationMap = new HashMap<>();
String[] resourceNames = conf.getStrings(YarnConfiguration.RESOURCE_TYPES); String[] resourceNames =
conf.getTrimmedStrings(YarnConfiguration.RESOURCE_TYPES);
if (resourceNames != null && resourceNames.length != 0) { if (resourceNames != null && resourceNames.length != 0) {
for (String resourceName : resourceNames) { for (String resourceName : resourceNames) {