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

Daniel Templeton commented on YARN-6789:
----------------------------------------

My comments:

# The javadocs on the first {{ResourceTypeInfo#newInstance()}} and 
{{ResourceTypeInfo#copy()}} refer to {{ResourceInformation}} instead of 
{{ResourceTypeInfo}}
# Missing the javadoc for the last three {{ResourceTypeInfo#newInstance()}} 
methods
# I'm incredulous that {{ {{ResourceTypeInfo#hashCode()}} is what you intended. 
 Should it maybe be:{code}    final int prime = 47;
    int result = prime + getName().hashCode();
    result = prime * result + getResourceType().hashCode();
    return result;{code} 939769357 / 263167 = 3571, which is a number that 
doesn't appear in the code.  There's also no need to choose a large prime.  In 
fact, choosing a prime that's too large will result in overflows.  See 
https://www.sitepoint.com/how-to-implement-javas-hashcode-correctly/ rather 
than that silly SO article.
# In {{ResourceUtils#getDefaultUnit()}}, the {{(null == x)}} idiom is from C 
and has no purpose in Java.  Doubly so for {{(null != x)}} which doesn't even 
have a purpose in C.
# In {{ResourcePBImpl}}, now that {{initResources()}} in called from both 
constructors, does it still need to be called from the accessors?
# Why the change in {{DominantResourceCalculator}}?
# It would be nice to have messages in the asserts in the test classes.
# I don't think {{ClientRMService#getResourceTypeInfo()}} should require 
resource profiles to be enabled.  Why can't the {{ClientRMService}} just grab 
the info from {{ResourceUtils}} itself?
# Does anyone consume the new variable in {{TestCapacityScheduler}}?

> new api to get all supported resources from RM
> ----------------------------------------------
>
>                 Key: YARN-6789
>                 URL: https://issues.apache.org/jira/browse/YARN-6789
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: nodemanager, resourcemanager
>            Reporter: Sunil G
>            Assignee: Sunil G
>         Attachments: YARN-6789-YARN-3926.001.patch, 
> YARN-6789-YARN-3926.002_incomplete_.patch, YARN-6789-YARN-3926.003.patch, 
> YARN-6789-YARN-3926.004.patch
>
>
> It will be better to provide an api to get all supported resource types from 
> RM.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to