[
https://issues.apache.org/jira/browse/YARN-7180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16198387#comment-16198387
]
Sunil G commented on YARN-7180:
-------------------------------
Thanks [~templedf]
To me, I think the whole feature done in YARN-2162 is not considered multiple
resource types. Hence fixing a part of it may not help much.
{code}
/**
* Parses a resource config value of a form like "1024", "1024 mb",
* or "1024 mb, 3 vcores". If no units are given, megabytes are assumed.
*
* @throws AllocationConfigurationException
*/
public static ConfigurableResource parseResourceConfigValue(String val)
throws AllocationConfigurationException {
ConfigurableResource configurableResource;
try {
val = StringUtils.toLowerCase(val);
if (val.contains("%")) {
configurableResource = new ConfigurableResource(
getResourcePercentage(val));
} else {
int memory = findResource(val, "mb");
int vcores = findResource(val, "vcores");
configurableResource = new ConfigurableResource(
BuilderUtils.newResource(memory, vcores));
}
}
{code}
If you see here, it expects a string like {{"1024 mb, 3 vcores"}} and for other
resources, nothing is defined. So we have to use ResourceUtils for this and
then change the behavior of {{ConfigurableResource}} etc. I think a followup
jira for YARN-2162 could be created and handle this cleanly.
For now if its fine, we can get this jira in as we could avoid potential
mis-use of *ResourceType* class.
> Remove class ResourceType
> -------------------------
>
> Key: YARN-7180
> URL: https://issues.apache.org/jira/browse/YARN-7180
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: resourcemanager, scheduler
> Reporter: Yufei Gu
> Assignee: Sunil G
> Attachments: YARN-7180.001.patch, YARN-7180.002.patch
>
>
> org.apache.hadoop.yarn.server.resourcemanager.resource.ResourceType isn't
> needed any more with the new resource type change.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]