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

Varun Vasudev commented on YARN-4895:
-------------------------------------

# [~kkaranasos] - the function name "subtractFrom" implies that you're going to 
subtract the memory and cpu of the object from the values that are passed to 
the function and return a new object. Maybe just name it "subtract"? On a 
similar note, "addTo" should really be called just "add". 
#  {code}
+  @Public
+  @Unstable
+  public static ResourceUtilization newInstance(
+      ResourceUtilization resourceUtil) {
+    return newInstance(resourceUtil.getPhysicalMemory(),
+        resourceUtil.getVirtualMemory(), resourceUtil.getCPU());
+  }
{code}
doesn't seem related to this patch - did you add it just as a good to have?
# It looks like there are no tests for the ResourceUtilization class at all. 
Can you please add some tests?

> Add subtractFrom method to ResourceUtilization class
> ----------------------------------------------------
>
>                 Key: YARN-4895
>                 URL: https://issues.apache.org/jira/browse/YARN-4895
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Konstantinos Karanasos
>            Assignee: Konstantinos Karanasos
>         Attachments: YARN-4895.001.patch
>
>
> In ResourceUtilization class, there is already an addTo method. 
> For completeness, here we are adding the dual subtractFrom method.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to