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

Weiwei Yang commented on YARN-7892:
-----------------------------------

Hi [~Naganarasimha], [~sunilg]

I think we should check both prefix/key/name/value in equals (hashcode), 
otherwise how we can tell if two attributes are same? For example if we have 
following attributes on h1 and h2,
{code:java}
h1: A=A1
h2: A=A2
{code}
In attribute-manager, we use node-attribute as a key that maps to a list of 
nodes have this attribute,

attribute -> nodes

with this patch, the mapping will be like
{code:java}
A: [h1, h2]
{code}
but when we do placement decision, we want to put a container on only nodes 
where {{A=A1}}, then how can this be done?

Regarding to [~Naganarasimha]'s concern
{quote}Else in every place we need to separately start storing with Name and 
prefix what are the attributes for example 7856 is newly introducing a map to 
just compare whether any duplicates exists.
{quote}
This can be resolved by an utility class method, e.g 
{{NodeAttributeUtils#sameAttributeKey(NodeAttribute na1, NodeAttribute na2)}}, 
or something similar, not a big problem.

Does this make sense?

Thanks.

> NodeAttributePBImpl does not implement hashcode and Equals properly
> -------------------------------------------------------------------
>
>                 Key: YARN-7892
>                 URL: https://issues.apache.org/jira/browse/YARN-7892
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>            Reporter: Naganarasimha G R
>            Assignee: Naganarasimha G R
>            Priority: Major
>         Attachments: YARN-7892-YARN-3409.001.patch, 
> YARN-7892-YARN-3409.002.patch
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to