[ https://issues.apache.org/jira/browse/YARN-7892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462653#comment-16462653 ]
Bibin A Chundatt commented on YARN-7892: ---------------------------------------- [~Naganarasimha] {quote} For both getClusterAttributes and getAttributes to node we are iterating over all the attribute ids two times. Can we optimize the same ? {quote} # ClientRMService#getAttributesToNodes -> NodeAttributeManager#getAttributesToNodes(). for all the unique nodeAtttributes in cluster we will be iterating once in ClientRMService and NodeAttributeManager. # YarnClient#getAttributesToNodes API change is it required to have AttributeValues along with Hostname. Since we have node to NodeAttribute mapping is this really required. Can you share me in what case we will be able to use this ? Method need to be renamed to match current functionality. # Java doc update GetAttributesToNodesRequest#setNodeAttributes # Java doc update GetAttributesToNodesRequest#getNodeAttributes # Java doc GetAttributesToNodesResponse#getAttributesToNodes specify fields of map corresponds to # Java doc GetAttributesToNodesResponse class level # GetClusterNodeAttributesResponse#setNodeAttributes(Set<NodeAttributeInfo> attributes); java doc mismatch # YarnClient for methods updated java doc need to be updated {code} /** * Given a attribute set, return what all Nodes have attribute mapped to it. * If the attributes set is null or empty, all attributes mapping are * returned. * * @return a Map of attributes to set of hostnames. */ public abstract Map<NodeAttributeID, Map<String, AttributeValue>> getAttributesToNodes( Set<NodeAttributeID> attributes); {code} # NodeAttributeManager java doc update {noformat} ../patch/YARN-7892-YARN-3409.005.patch:1651: trailing whitespace. for (Map.Entry<NodeAttributeID, Map<String, AttributeValue>> attrib : ../patch/YARN-7892-YARN-3409.005.patch:1917: trailing whitespace. for (Entry<NodeAttributeID, RMNodeAttribute> attributeEntry : warning: 2 lines add whitespace errors. {noformat} # Fix whitespace errors > Revisit NodeAttribute class structure > ------------------------------------- > > 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, YARN-7892-YARN-3409.003.WIP.patch, > YARN-7892-YARN-3409.003.patch, YARN-7892-YARN-3409.004.patch, > YARN-7892-YARN-3409.005.patch > > > In the existing structure, we had kept the type and value along with the > attribute which would create confusion to the user to understand the APIs as > they would not be clear as to what needs to be sent for type and value while > fetching the mappings for node(s). > As well as equals will not make sense when we compare only for prefix and > name where as values for them might be different. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org