hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvasu...@apache.org
Subject [02/21] hadoop git commit: YARN-4844. Add getMemoryLong/getVirtualCoreLong to o.a.h.y.api.records.Resource. Contributed by Wangda Tan.
Date Sun, 29 May 2016 15:30:02 GMT
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java
index 59666f5..cff1514 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestNodeLabelContainerAllocation.java
@@ -39,7 +39,6 @@ import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
 import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
 import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.NullRMNodeLabelsManager;
 import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
-import org.apache.hadoop.yarn.server.resourcemanager.recovery.MemoryRMStateStore;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
 import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer;
@@ -522,22 +521,22 @@ public class TestNodeLabelContainerAllocation {
     Assert.assertEquals(2, schedulerApp1.getLiveContainers().size());
     Assert.assertTrue(schedulerApp1.getReservedContainers().size() > 0);
     Assert.assertEquals(9 * GB, cs.getRootQueue().getQueueResourceUsage()
-        .getUsed("x").getMemory());
+        .getUsed("x").getMemorySize());
     Assert.assertEquals(4 * GB, cs.getRootQueue().getQueueResourceUsage()
-        .getReserved("x").getMemory());
+        .getReserved("x").getMemorySize());
     Assert.assertEquals(4 * GB,
-        leafQueue.getQueueResourceUsage().getReserved("x").getMemory());
+        leafQueue.getQueueResourceUsage().getReserved("x").getMemorySize());
 
     // Cancel asks of app2 and re-kick RM
     am1.allocate("*", 4 * GB, 0, new ArrayList<ContainerId>());
     cs.handle(new NodeUpdateSchedulerEvent(rmNode1));
 
     Assert.assertEquals(5 * GB, cs.getRootQueue().getQueueResourceUsage()
-        .getUsed("x").getMemory());
+        .getUsed("x").getMemorySize());
     Assert.assertEquals(0, cs.getRootQueue().getQueueResourceUsage()
-        .getReserved("x").getMemory());
+        .getReserved("x").getMemorySize());
     Assert.assertEquals(0, leafQueue.getQueueResourceUsage().getReserved("x")
-        .getMemory());
+        .getMemorySize());
     rm1.close();
   }
 
@@ -549,7 +548,7 @@ public class TestNodeLabelContainerAllocation {
         app.getAppSchedulingInfo().getResourceRequest(
             Priority.newInstance(priority), "*");
     Assert.assertEquals(memory,
-        rr.getCapability().getMemory() * rr.getNumContainers());
+        rr.getCapability().getMemorySize() * rr.getNumContainers());
   }
   
   private void checkLaunchedContainerNumOnNode(MockRM rm, NodeId nodeId,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java
index 23dc860..890e998 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java
@@ -174,14 +174,14 @@ public class TestParentQueue {
   private float computeQueueAbsoluteUsedCapacity(CSQueue queue, 
       int expectedMemory, Resource clusterResource) {
     return (
-        ((float)expectedMemory / (float)clusterResource.getMemory())
+        ((float)expectedMemory / (float)clusterResource.getMemorySize())
       );
   }
   
   private float computeQueueUsedCapacity(CSQueue queue,
       int expectedMemory, Resource clusterResource) {
     return (expectedMemory / 
-        (clusterResource.getMemory() * queue.getAbsoluteCapacity()));
+        (clusterResource.getMemorySize() * queue.getAbsoluteCapacity()));
   }
   
   final static float DELTA = 0.0001f;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueCapacities.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueCapacities.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueCapacities.java
index 356ed46..ee370b4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueCapacities.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueCapacities.java
@@ -117,7 +117,7 @@ public class TestQueueCapacities {
   }
 
   void check(int mem, int cpu, Resource res) {
-    Assert.assertEquals(mem, res.getMemory());
+    Assert.assertEquals(mem, res.getMemorySize());
     Assert.assertEquals(cpu, res.getVirtualCores());
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java
index 632b547..e8ac804 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestReservations.java
@@ -266,88 +266,88 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(22 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(19 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(16 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(16 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(16 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // try to assign reducer (5G on node 0 and should reserve)
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(11 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(11 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // assign reducer to node 2
     a.assignContainers(clusterResource, node_2,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(18 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(18 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(6 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(6 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(6 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(1, app_0.getTotalRequiredResources(priorityReduce));
 
     // node_1 heartbeat and unreserves from node_0 in order to allocate
     // on node_1
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(18 * GB, a.getUsedResources().getMemory());
-    assertEquals(18 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(18 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(18 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(18 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(6 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(6 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(6 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(8 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(8 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(0, app_0.getTotalRequiredResources(priorityReduce));
   }
 
@@ -428,27 +428,27 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
-    assertEquals(0 * GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(0 * GB, app_1.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(22 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
-    assertEquals(2 * GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(2 * GB, app_1.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(4 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(20 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(2 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(2 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Add a few requests to each app
     app_0.updateResourceRequests(Collections.singletonList(TestUtils
@@ -461,29 +461,29 @@ public class TestReservations {
     // add a reservation for app_0
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(12 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
-    assertEquals(2 * GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(12 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(2 * GB, app_1.getCurrentConsumption().getMemorySize());
     assertEquals(8 * GB, a.getMetrics().getReservedMB());
     assertEquals(4 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(12 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(2 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(2 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // next assignment is beyond user limit for user_0 but it should assign to
     // app_1 for user_1
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(14 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
-    assertEquals(4 * GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(14 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(4 * GB, app_1.getCurrentConsumption().getMemorySize());
     assertEquals(8 * GB, a.getMetrics().getReservedMB());
     assertEquals(6 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(10 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(4 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(4 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
   }
 
   @Test
@@ -563,89 +563,89 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(22 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(19 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(16 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(16 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(16 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // try to assign reducer (5G on node 0 and should reserve)
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(11 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(11 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // assign reducer to node 2
     a.assignContainers(clusterResource, node_2,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(18 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(18 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(6 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(6 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(6 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(1, app_0.getTotalRequiredResources(priorityReduce));
 
     // node_1 heartbeat and won't unreserve from node_0, potentially stuck
     // if AM doesn't handle
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(18 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(18 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(6 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(6 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(6 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
     assertEquals(1, app_0.getTotalRequiredResources(priorityReduce));
   }
 
@@ -723,66 +723,66 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(14 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(8 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(8 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(8 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // try to assign reducer (5G on node 0 and should reserve)
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(5 * GB, node_0.getReservedContainer().getReservedResource()
-        .getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+        .getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
     assertEquals(2, app_0.getTotalRequiredResources(priorityReduce));
 
     // could allocate but told need to unreserve first
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(8 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(8 * GB, node_1.getAllocatedResource().getMemorySize());
     assertEquals(1, app_0.getTotalRequiredResources(priorityReduce));
   }
 
@@ -986,50 +986,50 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(14 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(8 * GB, a.getMetrics().getAvailableMB());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // now add in reservations and make sure it continues if config set
     // allocate to queue so that the potential new capacity is greater then
     // absoluteMaxCapacity
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
 
     ResourceLimits limits =
         new ResourceLimits(Resources.createResource(13 * GB));
@@ -1042,7 +1042,7 @@ public class TestReservations {
     // 16GB total, 13GB consumed (8 allocated, 5 reserved). asking for 5GB so we would have to
     // unreserve 2GB to get the total 5GB needed.
     // also note vcore checks not enabled
-    assertEquals(0, limits.getHeadroom().getMemory());
+    assertEquals(0, limits.getHeadroom().getMemorySize());
 
     refreshQueuesTurnOffReservationsContLook(a, csConf);
 
@@ -1160,52 +1160,52 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(14 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(8 * GB, a.getMetrics().getAvailableMB());
     assertEquals(null, node_0.getReservedContainer());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // now add in reservations and make sure it continues if config set
     // allocate to queue so that the potential new capacity is greater then
     // absoluteMaxCapacity
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentReservation().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentReservation().getMemorySize());
 
     assertEquals(5 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
 
     // not over the limit
     Resource limit = Resources.createResource(14 * GB, 0);
@@ -1312,39 +1312,39 @@ public class TestReservations {
     // Only AM
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2 * GB, a.getUsedResources().getMemory());
-    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(2 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(2 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(22 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(2 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map - simulating reduce
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5 * GB, a.getUsedResources().getMemory());
-    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(5 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(5 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(5 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(19 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // Only 1 map to other node - simulating reduce
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(16 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(16 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(16 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // try to assign reducer (5G on node 0), but tell it's resource limits <
     // used (8G) + required (5G). It will not reserved since it has to unreserve
@@ -1352,72 +1352,72 @@ public class TestReservations {
     // unreserve resource to reserve container.
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(Resources.createResource(10 * GB)), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(16 * GB, a.getMetrics().getAvailableMB());
     // app_0's headroom = limit (10G) - used (8G) = 2G 
-    assertEquals(2 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // try to assign reducer (5G on node 0), but tell it's resource limits <
     // used (8G) + required (5G). It will not reserved since it has to unreserve
     // some resource. Unfortunately, there's nothing to unreserve.
     a.assignContainers(clusterResource, node_2,
         new ResourceLimits(Resources.createResource(10 * GB)), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8 * GB, a.getUsedResources().getMemory());
-    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(8 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(8 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(8 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(16 * GB, a.getMetrics().getAvailableMB());
     // app_0's headroom = limit (10G) - used (8G) = 2G 
-    assertEquals(2 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(0 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(2 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(0 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // let it assign 5G to node_2
     a.assignContainers(clusterResource, node_2,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(13 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(13 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(0 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(11 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(11 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(11 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // reserve 8G node_0
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(21 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(21 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(8 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
 
     // try to assign (8G on node 2). No room to allocate,
     // continued to try due to having reservation above,
     // but hits queue limits so can't reserve anymore.
     a.assignContainers(clusterResource, node_2,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(21 * GB, a.getUsedResources().getMemory());
-    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(21 * GB, a.getUsedResources().getMemorySize());
+    assertEquals(13 * GB, app_0.getCurrentConsumption().getMemorySize());
     assertEquals(8 * GB, a.getMetrics().getReservedMB());
     assertEquals(13 * GB, a.getMetrics().getAllocatedMB());
     assertEquals(3 * GB, a.getMetrics().getAvailableMB());
-    assertEquals(3 * GB, app_0.getHeadroom().getMemory());
-    assertEquals(5 * GB, node_0.getAllocatedResource().getMemory());
-    assertEquals(3 * GB, node_1.getAllocatedResource().getMemory());
-    assertEquals(5 * GB, node_2.getAllocatedResource().getMemory());
+    assertEquals(3 * GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(5 * GB, node_0.getAllocatedResource().getMemorySize());
+    assertEquals(3 * GB, node_1.getAllocatedResource().getMemorySize());
+    assertEquals(5 * GB, node_2.getAllocatedResource().getMemorySize());
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestWorkPreservingRMRestartForNodeLabel.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestWorkPreservingRMRestartForNodeLabel.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestWorkPreservingRMRestartForNodeLabel.java
index cb62ba0..0386aab 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestWorkPreservingRMRestartForNodeLabel.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestWorkPreservingRMRestartForNodeLabel.java
@@ -112,14 +112,14 @@ public class TestWorkPreservingRMRestartForNodeLabel {
     FiCaSchedulerApp app =
         cs.getSchedulerApplications().get(appId).getCurrentAppAttempt();
     Assert.assertEquals(expectedMemUsage, app.getAppAttemptResourceUsage()
-        .getUsed(partition).getMemory());
+        .getUsed(partition).getMemorySize());
   }
   
   private void checkQueueResourceUsage(String partition, String queueName, MockRM rm, int expectedMemUsage) {
     CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
     CSQueue queue = cs.getQueue(queueName);
     Assert.assertEquals(expectedMemUsage, queue.getQueueResourceUsage()
-        .getUsed(partition).getMemory());
+        .getUsed(partition).getMemorySize());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerTestBase.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerTestBase.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerTestBase.java
index 0e1d904..ec0e6aa 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerTestBase.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairSchedulerTestBase.java
@@ -275,8 +275,8 @@ public class FairSchedulerTestBase {
     }
 
     // available resource
-    Assert.assertEquals(resource.getMemory(),
-        app.getCurrentConsumption().getMemory());
+    Assert.assertEquals(resource.getMemorySize(),
+        app.getCurrentConsumption().getMemorySize());
     Assert.assertEquals(resource.getVirtualCores(),
         app.getCurrentConsumption().getVirtualCores());
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestComputeFairShares.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestComputeFairShares.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestComputeFairShares.java
index 9d8dd07..4f3ccb2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestComputeFairShares.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestComputeFairShares.java
@@ -196,7 +196,7 @@ public class TestComputeFairShares {
   private void verifyMemoryShares(int... shares) {
     Assert.assertEquals(scheds.size(), shares.length);
     for (int i = 0; i < shares.length; i++) {
-      Assert.assertEquals(shares[i], scheds.get(i).getFairShare().getMemory());
+      Assert.assertEquals(shares[i], scheds.get(i).getFairShare().getMemorySize());
     }
   }
   

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
index 2e7b3f8..f7b5f3b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestContinuousScheduling.java
@@ -125,7 +125,7 @@ public class TestContinuousScheduling extends FairSchedulerTestBase {
     scheduler.handle(nodeEvent2);
 
     // available resource
-    Assert.assertEquals(scheduler.getClusterResource().getMemory(), 16 * 1024);
+    Assert.assertEquals(scheduler.getClusterResource().getMemorySize(), 16 * 1024);
     Assert.assertEquals(scheduler.getClusterResource().getVirtualCores(), 16);
 
     // send application request

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppAttempt.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppAttempt.java
index e733b1c..1901fa9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppAttempt.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSAppAttempt.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.server.resourcemanager.MockNodes;
 import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
@@ -30,7 +29,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 
@@ -238,9 +236,9 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     Mockito.when(mockQueue.getPolicy()).thenReturn(SchedulingPolicy
         .getInstance(DominantResourceFairnessPolicy.class));
     verifyHeadroom(schedulerApp,
-        min(queueStarvation.getMemory(),
-            clusterAvailable.getMemory(),
-            queueMaxResourcesAvailable.getMemory()),
+        min(queueStarvation.getMemorySize(),
+            clusterAvailable.getMemorySize(),
+            queueMaxResourcesAvailable.getMemorySize()),
         min(queueStarvation.getVirtualCores(),
             clusterAvailable.getVirtualCores(),
             queueMaxResourcesAvailable.getVirtualCores())
@@ -250,9 +248,9 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     Mockito.when(mockQueue.getPolicy()).thenReturn(SchedulingPolicy
         .getInstance(FairSharePolicy.class));
     verifyHeadroom(schedulerApp,
-        min(queueStarvation.getMemory(),
-            clusterAvailable.getMemory(),
-            queueMaxResourcesAvailable.getMemory()),
+        min(queueStarvation.getMemorySize(),
+            clusterAvailable.getMemorySize(),
+            queueMaxResourcesAvailable.getMemorySize()),
         Math.min(
             clusterAvailable.getVirtualCores(),
             queueMaxResourcesAvailable.getVirtualCores())
@@ -261,9 +259,9 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     Mockito.when(mockQueue.getPolicy()).thenReturn(SchedulingPolicy
         .getInstance(FifoPolicy.class));
     verifyHeadroom(schedulerApp,
-        min(queueStarvation.getMemory(),
-            clusterAvailable.getMemory(),
-            queueMaxResourcesAvailable.getMemory()),
+        min(queueStarvation.getMemorySize(),
+            clusterAvailable.getMemorySize(),
+            queueMaxResourcesAvailable.getMemorySize()),
         Math.min(
             clusterAvailable.getVirtualCores(),
             queueMaxResourcesAvailable.getVirtualCores())
@@ -288,9 +286,9 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     Resource clusterResource = scheduler.getClusterResource();
     Resource clusterUsage = scheduler.getRootQueueMetrics()
         .getAllocatedResources();
-    assertEquals(12 * 1024, clusterResource.getMemory());
+    assertEquals(12 * 1024, clusterResource.getMemorySize());
     assertEquals(12, clusterResource.getVirtualCores());
-    assertEquals(0, clusterUsage.getMemory());
+    assertEquals(0, clusterUsage.getMemorySize());
     assertEquals(0, clusterUsage.getVirtualCores());
     ApplicationAttemptId id11 = createAppAttemptId(1, 1);
     createMockRMApp(id11);
@@ -302,7 +300,7 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     FSAppAttempt app = scheduler.getSchedulerApp(id11);
     assertNotNull(app);
     Resource queueUsage = app.getQueue().getResourceUsage();
-    assertEquals(0, queueUsage.getMemory());
+    assertEquals(0, queueUsage.getMemorySize());
     assertEquals(0, queueUsage.getVirtualCores());
     SchedulerNode n1 = scheduler.getSchedulerNode(node1.getNodeID());
     SchedulerNode n2 = scheduler.getSchedulerNode(node2.getNodeID());
@@ -337,14 +335,14 @@ public class TestFSAppAttempt extends FairSchedulerTestBase {
     assertEquals(clusterResource, spyApp.getHeadroom());
   }
 
-  private static int min(int value1, int value2, int value3) {
+  private static long min(long value1, long value2, long value3) {
     return Math.min(Math.min(value1, value2), value3);
   }
 
   protected void verifyHeadroom(FSAppAttempt schedulerApp,
-                                int expectedMemory, int expectedCPU) {
+                                long expectedMemory, long expectedCPU) {
     Resource headroom = schedulerApp.getHeadroom();
-    assertEquals(expectedMemory, headroom.getMemory());
+    assertEquals(expectedMemory, headroom.getMemorySize());
     assertEquals(expectedCPU, headroom.getVirtualCores());
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ad977902/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
index 867fd22..ad4e2e4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSLeafQueue.java
@@ -43,7 +43,6 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.server.resourcemanager.MockNodes;
 import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
 import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
-import org.apache.hadoop.yarn.server.resourcemanager.metrics.SystemMetricsEvent;
 import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeAddedSchedulerEvent;
@@ -211,7 +210,7 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
 
     QueueManager queueMgr = scheduler.getQueueManager();
     FSLeafQueue queueA = queueMgr.getLeafQueue("queueA", false);
-    assertEquals(4 * 1024, queueA.getResourceUsage().getMemory());
+    assertEquals(4 * 1024, queueA.getResourceUsage().getMemorySize());
 
     // Both queue B1 and queue B2 want 3 * 1024
     createSchedulingRequest(1 * 1024, "queueB.queueB1", "user1", 3);
@@ -223,8 +222,8 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
 
     FSLeafQueue queueB1 = queueMgr.getLeafQueue("queueB.queueB1", false);
     FSLeafQueue queueB2 = queueMgr.getLeafQueue("queueB.queueB2", false);
-    assertEquals(2 * 1024, queueB1.getResourceUsage().getMemory());
-    assertEquals(2 * 1024, queueB2.getResourceUsage().getMemory());
+    assertEquals(2 * 1024, queueB1.getResourceUsage().getMemorySize());
+    assertEquals(2 * 1024, queueB2.getResourceUsage().getMemorySize());
 
     // For queue B1, the fairSharePreemptionThreshold is 0.4, and the fair share
     // threshold is 1.6 * 1024
@@ -237,8 +236,8 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
     // Node checks in again
     scheduler.handle(nodeEvent2);
     scheduler.handle(nodeEvent2);
-    assertEquals(3 * 1024, queueB1.getResourceUsage().getMemory());
-    assertEquals(3 * 1024, queueB2.getResourceUsage().getMemory());
+    assertEquals(3 * 1024, queueB1.getResourceUsage().getMemorySize());
+    assertEquals(3 * 1024, queueB2.getResourceUsage().getMemorySize());
 
     // Both queue B1 and queue B2 usages go to 3 * 1024
     assertFalse(queueB1.isStarvedForFairShare());
@@ -283,7 +282,7 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
 
     QueueManager queueMgr = scheduler.getQueueManager();
     FSLeafQueue queueA = queueMgr.getLeafQueue("queueA", false);
-    assertEquals(7 * 1024, queueA.getResourceUsage().getMemory());
+    assertEquals(7 * 1024, queueA.getResourceUsage().getMemorySize());
     assertEquals(1, queueA.getResourceUsage().getVirtualCores());
 
     // Queue B has 3 reqs :
@@ -298,7 +297,7 @@ public class TestFSLeafQueue extends FairSchedulerTestBase {
     }
 
     FSLeafQueue queueB = queueMgr.getLeafQueue("queueB", false);
-    assertEquals(3 * 1024, queueB.getResourceUsage().getMemory());
+    assertEquals(3 * 1024, queueB.getResourceUsage().getMemorySize());
     assertEquals(6, queueB.getResourceUsage().getVirtualCores());
 
     scheduler.update();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message