You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2017/12/13 16:51:00 UTC
[jira] [Commented] (YARN-7383) Node resource is not parsed
correctly for resource names containing dot
[ https://issues.apache.org/jira/browse/YARN-7383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16289516#comment-16289516 ]
Hudson commented on YARN-7383:
------------------------------
SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13367 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/13367/])
YARN-7383. Node resource is not parsed correctly for resource names (sunilg: rev 10fc8d2a7dc975ce70de63f88a2674389314f197)
* (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/resources/resource-types/resource-types-4.xml
* (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java
* (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/resources/resource-types/node-resources-2.xml
* (edit) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/resource/TestResourceUtils.java
> Node resource is 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
> Assignee: Gergely Novák
> Fix For: 3.1.0, 3.0.1
>
> Attachments: YARN-7383.001.patch, YARN-7383.002.patch
>
>
> 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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org