[ 
https://issues.apache.org/jira/browse/YARN-7383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16216108#comment-16216108
 ] 

Jonathan Hung commented on YARN-7383:
-------------------------------------

Currently the resource name for GPU is {{yarn.io/gpu}}. (If people use 
GpuResourcePlugin for GPU resource discovery, this ticket doesn't affect GPUs, 
but if we stick to using "." convention for namespace, this ticket will affect 
specifying node resources for them via {{node-resources.xml}}.)

> Node resource not parsed correctly for resource names containing dot
> --------------------------------------------------------------------
>
>                 Key: YARN-7383
>                 URL: https://issues.apache.org/jira/browse/YARN-7383
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: nodemanager, resourcemanager
>            Reporter: Jonathan Hung
>
> Currently when getting resource capabilities in {{node-resources.xml}}, the 
> following parsing code is used: {noformat}    String[] parts = 
> prop.split("\\.");
>     LOG.info("Found resource entry " + prop);
>     if (parts.length == 4) {
>       String resourceType = parts[3];
>       if (!nodeResources.containsKey(resourceType)) {
>         nodeResources
>             .put(resourceType, ResourceInformation.newInstance(resourceType));
>       }
>       String units = getUnits(value);
>       Long resourceValue =
>           Long.valueOf(value.substring(0, value.length() - units.length()));
>       nodeResources.get(resourceType).setValue(resourceValue);
>       nodeResources.get(resourceType).setUnits(units);
>       if (LOG.isDebugEnabled()) {
>         LOG.debug("Setting value for resource type " + resourceType + " to "
>             + resourceValue + " with units " + units);
>       }
>     }{noformat}
> If resource names contain dots though (e.g. for resource names in a 
> namespace) this will not parse correctly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to