YARN-10701. The yarn.resource-types should support multi types without trimmed. Contributed by Qi Zhu.
This commit is contained in:
parent
181b9ddc51
commit
3d4ea4b336
|
@ -251,7 +251,8 @@ public class ResourceUtils {
|
||||||
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) {
|
||||||
|
|
|
@ -17,6 +17,6 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<property>
|
<property>
|
||||||
<name>yarn.resource-types</name>
|
<name>yarn.resource-types</name>
|
||||||
<value>yarn.io/gpu</value>
|
<value>yarn.io/gpu, yarn.io/fpga</value>
|
||||||
</property>
|
</property>
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in New Issue