You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by wa...@apache.org on 2016/06/01 05:23:59 UTC

[3/7] hadoop git commit: Revert "YARn-4844. Add getMemoryLong/getVirtualCoreLong to o.a.h.y.api.records.Resource. Contributed by Wangda Tan."

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2f3e1d96/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.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/TestLeafQueue.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/TestLeafQueue.java
index 23f5102..383088a 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/TestLeafQueue.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/TestLeafQueue.java
@@ -324,7 +324,7 @@ public class TestLeafQueue {
     a.assignContainers(clusterResource, node_0, new ResourceLimits(
         clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
     assertEquals(
-        (int)(node_0.getTotalResource().getMemorySize() * a.getCapacity()) - (1*GB),
+        (int)(node_0.getTotalResource().getMemory() * a.getCapacity()) - (1*GB),
         a.getMetrics().getAvailableMB());
   }
 
@@ -406,7 +406,7 @@ public class TestLeafQueue {
     assertEquals(1, a.getMetrics().getAppsSubmitted());
     assertEquals(1, a.getMetrics().getAppsPending());
     assertEquals(1, a.getUser(user_0).getActiveApplications());
-    assertEquals(app_1.getAMResource().getMemorySize(), a.getMetrics()
+    assertEquals(app_1.getAMResource().getMemory(), a.getMetrics()
         .getUsedAMResourceMB());
     assertEquals(app_1.getAMResource().getVirtualCores(), a.getMetrics()
         .getUsedAMResourceVCores());
@@ -514,9 +514,9 @@ public class TestLeafQueue {
     // Only 1 container
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(1*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(1*GB, a.getMetrics().getAllocatedMB());
     assertEquals(0*GB, a.getMetrics().getAvailableMB());
@@ -525,18 +525,18 @@ public class TestLeafQueue {
     // you can get one container more than user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(2*GB, a.getMetrics().getAllocatedMB());
     
     // Can't allocate 3rd due to user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(2*GB, a.getMetrics().getAllocatedMB());
     
@@ -544,18 +544,18 @@ public class TestLeafQueue {
     a.setUserLimitFactor(10);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(3*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(3*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(3*GB, a.getMetrics().getAllocatedMB());
 
     // One more should work, for app_1, due to user-limit-factor
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(4*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(4*GB, a.getMetrics().getAllocatedMB());
 
@@ -564,9 +564,9 @@ public class TestLeafQueue {
     a.setMaxCapacity(0.5f);
     a.assignContainers(clusterResource, node_0, new ResourceLimits(
         clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(4*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(4*GB, a.getMetrics().getAllocatedMB());
     
@@ -578,9 +578,9 @@ public class TestLeafQueue {
               ContainerExitStatus.KILLED_BY_RESOURCEMANAGER),
           RMContainerEventType.KILL, null, true);
     }
-    assertEquals(1*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(1*GB, a.getMetrics().getAllocatedMB());
     
@@ -593,12 +593,12 @@ public class TestLeafQueue {
           RMContainerEventType.KILL, null, true);
     }
 
-    assertEquals(0*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(0*GB, a.getMetrics().getAllocatedMB());
-    assertEquals((int)(a.getCapacity() * node_0.getTotalResource().getMemorySize()),
+    assertEquals((int)(a.getCapacity() * node_0.getTotalResource().getMemory()),
         a.getMetrics().getAvailableMB());
   }
   
@@ -663,27 +663,27 @@ public class TestLeafQueue {
     // 1 container to user_0
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(3*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(3*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
 
     // Allocate one container to app_1. Even if app_0
     // submit earlier, it cannot get this container assigned since user_0
     // exceeded user-limit already. 
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(4*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
 
     // Allocate one container to app_0, before allocating this container,
     // user-limit = ceil((4 + 1) / 2) = 3G. app_0's used resource (3G) <=
     // user-limit.
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(7*GB, a.getUsedResources().getMemorySize());
-    assertEquals(6*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(7*GB, a.getUsedResources().getMemory());
+    assertEquals(6*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
 
     // app_0 doesn't have outstanding resources, there's only one active user.
     assertEquals("There should only be 1 active user!", 
@@ -742,7 +742,7 @@ public class TestLeafQueue {
         "", SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
 
     //maxqueue 16G, userlimit 13G, - 4G used = 9G
-    assertEquals(9*GB,app_0.getHeadroom().getMemorySize());
+    assertEquals(9*GB,app_0.getHeadroom().getMemory());
 
     //test case 2
     final ApplicationAttemptId appAttemptId_2 =
@@ -760,13 +760,13 @@ public class TestLeafQueue {
     qb.computeUserLimitAndSetHeadroom(app_0, clusterResource,
         "", SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
 
-    assertEquals(8*GB, qb.getUsedResources().getMemorySize());
-    assertEquals(4*GB, app_0.getCurrentConsumption().getMemorySize());
+    assertEquals(8*GB, qb.getUsedResources().getMemory());
+    assertEquals(4*GB, app_0.getCurrentConsumption().getMemory());
     //maxqueue 16G, userlimit 13G, - 4G used = 9G BUT
     //maxqueue 16G - used 8G (4 each app/user) = 8G max headroom (the new logic)
-    assertEquals(8*GB, app_0.getHeadroom().getMemorySize());
-    assertEquals(4*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(8*GB, app_2.getHeadroom().getMemorySize());
+    assertEquals(8*GB, app_0.getHeadroom().getMemory());
+    assertEquals(4*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(8*GB, app_2.getHeadroom().getMemory());
 
     //test case 3
     qb.finishApplication(app_0.getApplicationId(), user_0);
@@ -803,10 +803,10 @@ public class TestLeafQueue {
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
     qb.computeUserLimitAndSetHeadroom(app_3, clusterResource,
         "", SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, qb.getUsedResources().getMemorySize());
+    assertEquals(4*GB, qb.getUsedResources().getMemory());
     //maxqueue 16G, userlimit 7G, used (by each user) 2G, headroom 5G (both)
-    assertEquals(5*GB, app_3.getHeadroom().getMemorySize());
-    assertEquals(5*GB, app_1.getHeadroom().getMemorySize());
+    assertEquals(5*GB, app_3.getHeadroom().getMemory());
+    assertEquals(5*GB, app_1.getHeadroom().getMemory());
     //test case 4
     final ApplicationAttemptId appAttemptId_4 =
               TestUtils.getMockApplicationAttemptId(4, 0);
@@ -828,13 +828,13 @@ public class TestLeafQueue {
     //app3 is user1, active from last test case
     //maxqueue 16G, userlimit 13G, used 2G, would be headroom 10G BUT
     //10G in use, so max possible headroom is 6G (new logic)
-    assertEquals(6*GB, app_3.getHeadroom().getMemorySize());
+    assertEquals(6*GB, app_3.getHeadroom().getMemory());
     //testcase3 still active - 2+2+6=10
-    assertEquals(10*GB, qb.getUsedResources().getMemorySize());
+    assertEquals(10*GB, qb.getUsedResources().getMemory());
     //app4 is user 0
     //maxqueue 16G, userlimit 13G, used 8G, headroom 5G
     //(8G used is 6G from this test case - app4, 2 from last test case, app_1)
-    assertEquals(5*GB, app_4.getHeadroom().getMemorySize());
+    assertEquals(5*GB, app_4.getHeadroom().getMemory());
   }
 
   @Test
@@ -890,16 +890,16 @@ public class TestLeafQueue {
 
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(1*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     //Now, headroom is the same for all apps for a given user + queue combo
     //and a change to any app's headroom is reflected for all the user's apps
     //once those apps are active/have themselves calculated headroom for 
     //allocation at least one time
-    assertEquals(2*GB, app_0.getHeadroom().getMemorySize());
-    assertEquals(0*GB, app_1.getHeadroom().getMemorySize());//not yet active
-    assertEquals(0*GB, app_2.getHeadroom().getMemorySize());//not yet active
+    assertEquals(2*GB, app_0.getHeadroom().getMemory());
+    assertEquals(0*GB, app_1.getHeadroom().getMemory());//not yet active
+    assertEquals(0*GB, app_2.getHeadroom().getMemory());//not yet active
 
     app_1.updateResourceRequests(Collections.singletonList(
         TestUtils.createResourceRequest(ResourceRequest.ANY, 1*GB, 2, true,
@@ -907,12 +907,12 @@ public class TestLeafQueue {
 
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_0.getHeadroom().getMemorySize());
-    assertEquals(1*GB, app_1.getHeadroom().getMemorySize());//now active
-    assertEquals(0*GB, app_2.getHeadroom().getMemorySize());//not yet active
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_0.getHeadroom().getMemory());
+    assertEquals(1*GB, app_1.getHeadroom().getMemory());//now active
+    assertEquals(0*GB, app_2.getHeadroom().getMemory());//not yet active
 
     //Complete container and verify that headroom is updated, for both apps 
     //for the user
@@ -923,8 +923,8 @@ public class TestLeafQueue {
 	ContainerExitStatus.KILLED_BY_RESOURCEMANAGER),
     RMContainerEventType.KILL, null, true);
 
-    assertEquals(2*GB, app_0.getHeadroom().getMemorySize());
-    assertEquals(2*GB, app_1.getHeadroom().getMemorySize());
+    assertEquals(2*GB, app_0.getHeadroom().getMemory());
+    assertEquals(2*GB, app_1.getHeadroom().getMemory());
   }
 
   @Test
@@ -996,23 +996,23 @@ public class TestLeafQueue {
     // 1 container to user_0
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     // TODO, fix headroom in the future patch
-    assertEquals(1*GB, app_0.getHeadroom().getMemorySize());
+    assertEquals(1*GB, app_0.getHeadroom().getMemory());
       // User limit = 4G, 2 in use
-    assertEquals(0*GB, app_1.getHeadroom().getMemorySize());
+    assertEquals(0*GB, app_1.getHeadroom().getMemory()); 
       // the application is not yet active
 
     // Again one to user_0 since he hasn't exceeded user limit yet
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(3*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_0.getHeadroom().getMemorySize()); // 4G - 3G
-    assertEquals(1*GB, app_1.getHeadroom().getMemorySize()); // 4G - 3G
+    assertEquals(3*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_0.getHeadroom().getMemory()); // 4G - 3G
+    assertEquals(1*GB, app_1.getHeadroom().getMemory()); // 4G - 3G
     
     // Submit requests for app_1 and set max-cap
     a.setMaxCapacity(.1f);
@@ -1025,12 +1025,12 @@ public class TestLeafQueue {
     // and no more containers to queue since it's already at max-cap
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(3*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_0.getHeadroom().getMemorySize());
-    assertEquals(0*GB, app_1.getHeadroom().getMemorySize());
+    assertEquals(3*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_0.getHeadroom().getMemory());
+    assertEquals(0*GB, app_1.getHeadroom().getMemory());
     
     // Check headroom for app_2 
     app_1.updateResourceRequests(Collections.singletonList(     // unset
@@ -1039,7 +1039,7 @@ public class TestLeafQueue {
     assertEquals(1, a.getActiveUsersManager().getNumActiveUsers());
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(0*GB, app_2.getHeadroom().getMemorySize());   // hit queue max-cap
+    assertEquals(0*GB, app_2.getHeadroom().getMemory());   // hit queue max-cap 
   }
 
   @Test
@@ -1110,25 +1110,25 @@ public class TestLeafQueue {
     // Only 1 container
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(1*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
 
     // Also 2nd -> minCapacity = 1024 since (.1 * 8G) < minAlloc, also
     // you can get one container more than user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     
     // Can't allocate 3rd due to user-limit
     a.setUserLimit(25);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     
     // Submit resource requests for other apps now to 'activate' them
     
@@ -1145,32 +1145,32 @@ public class TestLeafQueue {
     a.setUserLimitFactor(10);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(5*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     // Now allocations should goto app_0 since 
     // user_0 is at user-limit not above it
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(6*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(6*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
     
     // Test max-capacity
     // Now - no more allocs since we are at max-cap
     a.setMaxCapacity(0.5f);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(6*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(6*GB, a.getUsedResources().getMemory());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
     
     // Revert max-capacity and user-limit-factor
     // Now, allocations should goto app_3 since it's under user-limit 
@@ -1178,20 +1178,20 @@ public class TestLeafQueue {
     a.setUserLimitFactor(1);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(7*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(7*GB, a.getUsedResources().getMemory()); 
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_3.getCurrentConsumption().getMemory());
 
     // Now we should assign to app_3 again since user_2 is under user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(8*GB, a.getUsedResources().getMemorySize());
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(8*GB, a.getUsedResources().getMemory()); 
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_3.getCurrentConsumption().getMemory());
 
     // 8. Release each container from app_0
     for (RMContainer rmContainer : app_0.getLiveContainers()) {
@@ -1201,11 +1201,11 @@ public class TestLeafQueue {
               ContainerExitStatus.KILLED_BY_RESOURCEMANAGER),
           RMContainerEventType.KILL, null, true);
     }
-    assertEquals(5*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(3*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(5*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(3*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_3.getCurrentConsumption().getMemory());
     
     // 9. Release each container from app_2
     for (RMContainer rmContainer : app_2.getLiveContainers()) {
@@ -1215,11 +1215,11 @@ public class TestLeafQueue {
               ContainerExitStatus.KILLED_BY_RESOURCEMANAGER),
           RMContainerEventType.KILL, null, true);
     }
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_3.getCurrentConsumption().getMemory());
 
     // 10. Release each container from app_3
     for (RMContainer rmContainer : app_3.getLiveContainers()) {
@@ -1229,11 +1229,11 @@ public class TestLeafQueue {
               ContainerExitStatus.KILLED_BY_RESOURCEMANAGER),
           RMContainerEventType.KILL, null, true);
     }
-    assertEquals(0*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
   }
   
   @Test
@@ -1287,9 +1287,9 @@ public class TestLeafQueue {
     // Only 1 container
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(1L*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1L*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(1*GB, a.getMetrics().getAllocatedMB());
     assertEquals(0*GB, a.getMetrics().getAvailableMB());
@@ -1298,20 +1298,20 @@ public class TestLeafQueue {
     // you can get one container more than user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(2*GB, a.getMetrics().getAllocatedMB());
     
     // Now, reservation should kick in for app_1
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(6*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(2*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(6*GB, a.getUsedResources().getMemory()); 
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(2*GB, node_0.getUsedResource().getMemory());
     assertEquals(4*GB, a.getMetrics().getReservedMB());
     assertEquals(2*GB, a.getMetrics().getAllocatedMB());
     
@@ -1324,12 +1324,11 @@ public class TestLeafQueue {
         RMContainerEventType.KILL, null, true);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-
-    assertEquals(5*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(1*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(5*GB, a.getUsedResources().getMemory()); 
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(1*GB, node_0.getUsedResource().getMemory());
     assertEquals(4*GB, a.getMetrics().getReservedMB());
     assertEquals(1*GB, a.getMetrics().getAllocatedMB());
 
@@ -1342,11 +1341,11 @@ public class TestLeafQueue {
         RMContainerEventType.KILL, null, true);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(4*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(4*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(4*GB, node_0.getUsedResource().getMemory());
     assertEquals(0*GB, a.getMetrics().getReservedMB());
     assertEquals(4*GB, a.getMetrics().getAllocatedMB());
   }
@@ -1416,26 +1415,26 @@ public class TestLeafQueue {
     // Only 1 container
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(1*GB, a.getUsedResources().getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, a.getUsedResources().getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
 
     // Also 2nd -> minCapacity = 1024 since (.1 * 8G) < minAlloc, also
     // you can get one container more than user-limit
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, a.getUsedResources().getMemorySize());
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, a.getUsedResources().getMemory());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     
     // Now, reservation should kick in for app_1
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(6*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(2*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(6*GB, a.getUsedResources().getMemory()); 
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(2*GB, node_0.getUsedResource().getMemory());
     
     // Now free 1 container from app_0 i.e. 1G, and re-reserve it
     RMContainer rmContainer = app_0.getLiveContainers().iterator().next();
@@ -1446,31 +1445,31 @@ public class TestLeafQueue {
         RMContainerEventType.KILL, null, true);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(1*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(5*GB, a.getUsedResources().getMemory()); 
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(1*GB, node_0.getUsedResource().getMemory());
     assertEquals(1, app_1.getReReservations(priority));
 
     // Re-reserve
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(5*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(1*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(5*GB, a.getUsedResources().getMemory()); 
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(1*GB, node_0.getUsedResource().getMemory());
     assertEquals(2, app_1.getReReservations(priority));
     
     // Try to schedule on node_1 now, should *move* the reservation
     a.assignContainers(clusterResource, node_1,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(9*GB, a.getUsedResources().getMemorySize()); 
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(4*GB, node_1.getUsedResource().getMemorySize());
+    assertEquals(9*GB, a.getUsedResources().getMemory()); 
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(4*GB, node_1.getUsedResource().getMemory());
     // Doesn't change yet... only when reservation is cancelled or a different
     // container is reserved
     assertEquals(2, app_1.getReReservations(priority)); 
@@ -1484,11 +1483,11 @@ public class TestLeafQueue {
         RMContainerEventType.KILL, null, true);
     a.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(4*GB, a.getUsedResources().getMemorySize());
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(4*GB, app_1.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentReservation().getMemorySize());
-    assertEquals(0*GB, node_0.getUsedResource().getMemorySize());
+    assertEquals(4*GB, a.getUsedResources().getMemory());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(4*GB, app_1.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentReservation().getMemory());
+    assertEquals(0*GB, node_0.getUsedResource().getMemory());
   }
   
   private void verifyContainerAllocated(CSAssignment assignment, NodeType nodeType) {
@@ -2446,9 +2445,9 @@ public class TestLeafQueue {
 
     // app_1 will get containers as it has high priority
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
 
     app_0_requests_0.clear();
     app_0_requests_0.add(
@@ -2464,12 +2463,12 @@ public class TestLeafQueue {
 
     //app_1 will still get assigned first as priority is more.
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(2*GB, app_1.getCurrentConsumption().getMemorySize());
-    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(2*GB, app_1.getCurrentConsumption().getMemory());
+    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
 
     //and only then will app_2
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
 }
   @Test
   public void testConcurrentAccess() throws Exception {
@@ -2593,9 +2592,9 @@ public class TestLeafQueue {
 
     // app_0 will get containers as its submitted first.
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
 
     app_0_requests_0.clear();
     app_0_requests_0.add(
@@ -2612,12 +2611,12 @@ public class TestLeafQueue {
     //Since it already has more resources, app_0 will not get
     //assigned first, but app_1 will
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    Assert.assertEquals(2*GB, app_1.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    Assert.assertEquals(2*GB, app_1.getCurrentConsumption().getMemory());
 
     //and only then will app_0
     a.assignContainers(clusterResource, node_0_0, new ResourceLimits(clusterResource), SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    Assert.assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
+    Assert.assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
 
   }
   
@@ -2772,10 +2771,10 @@ public class TestLeafQueue {
     // all users (only user_0) queue 'e' should be able to consume 1GB.
     // The first container should be assigned to app_0 with no headroom left
     // even though user_0's apps are still asking for a total of 4GB.
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-                   clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+                   clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     // Assign 2nd container of 1GB
     e.assignContainers(clusterResource, node_0,
@@ -2785,19 +2784,19 @@ public class TestLeafQueue {
     // scheduler will assign one container more than user-limit-factor.
     // This container also went to app_0. Still with no neadroom even though
     // app_0 and app_1 are asking for a cumulative 3GB.
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     // Can't allocate 3rd container due to user-limit. Headroom still 0.
     e.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource),
         SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(2*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     // Increase user-limit-factor from 1GB to 10GB (1% * 10 * 100GB = 10GB).
     // Pending for both app_0 and app_1 are still 3GB, so user-limit-factor
@@ -2805,16 +2804,16 @@ public class TestLeafQueue {
     // getTotalPendingResourcesConsideringUserLimit()
     e.setUserLimitFactor(10.0f);
     assertEquals(3*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     e.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource),
         SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
     // app_0 is now satisified, app_1 is still asking for 2GB.
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(2*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     // Get the last 2 containers for app_1, no more pending requests.
     e.assignContainers(clusterResource, node_0,
@@ -2823,10 +2822,10 @@ public class TestLeafQueue {
     e.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource),
         SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
-    assertEquals(3*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(3*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_1.getCurrentConsumption().getMemory());
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
 
     // Release each container from app_0
     for (RMContainer rmContainer : app_0.getLiveContainers()) {
@@ -2928,14 +2927,14 @@ public class TestLeafQueue {
     // With queue capacity set at 1% of 100GB and user-limit-factor set to 1.0,
     // queue 'e' should be able to consume 1GB per user.
     assertEquals(2*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // None of the apps have assigned resources
     // user_0's apps:
-    assertEquals(0*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     // Assign 1st Container of 1GB
     e.assignContainers(clusterResource, node_0,
@@ -2944,13 +2943,13 @@ public class TestLeafQueue {
    // The first container was assigned to user_0's app_0. Queues total headroom
     // has 1GB left for user_1.
     assertEquals(1*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     // Assign 2nd container of 1GB
     e.assignContainers(clusterResource, node_0,
@@ -2961,13 +2960,13 @@ public class TestLeafQueue {
     // this container went to user_0's app_1. so, headroom for queue 'e'e is
     // still 1GB for user_1
     assertEquals(1*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(0*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(0*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     // Assign 3rd container.
     e.assignContainers(clusterResource, node_0,
@@ -2976,13 +2975,13 @@ public class TestLeafQueue {
     // Container was allocated to user_1's app_2 since user_1, Now, no headroom
     // is left.
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(1*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     // Assign 4th container.
     e.assignContainers(clusterResource, node_0,
@@ -2991,16 +2990,16 @@ public class TestLeafQueue {
     // Allocated to user_1's app_2 since scheduler allocates 1 container
     // above user resource limit. Available headroom still 0.
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    long app_0_consumption = app_0.getCurrentConsumption().getMemorySize();
+    int app_0_consumption = app_0.getCurrentConsumption().getMemory();
     assertEquals(1*GB, app_0_consumption);
-    long app_1_consumption = app_1.getCurrentConsumption().getMemorySize();
+    int app_1_consumption = app_1.getCurrentConsumption().getMemory();
     assertEquals(1*GB, app_1_consumption);
     // user_1's apps:
-    long app_2_consumption = app_2.getCurrentConsumption().getMemorySize();
+    int app_2_consumption = app_2.getCurrentConsumption().getMemory();
     assertEquals(2*GB, app_2_consumption);
-    long app_3_consumption = app_3.getCurrentConsumption().getMemorySize();
+    int app_3_consumption = app_3.getCurrentConsumption().getMemory();
     assertEquals(0*GB, app_3_consumption);
 
     // Attempt to assign 5th container. Will be a no-op.
@@ -3010,13 +3009,13 @@ public class TestLeafQueue {
     // Cannot allocate 5th container because both users are above their allowed
     // user resource limit. Values should be the same as previously.
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    assertEquals(app_0_consumption, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(app_1_consumption, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(app_0_consumption, app_0.getCurrentConsumption().getMemory());
+    assertEquals(app_1_consumption, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(app_2_consumption, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(app_3_consumption, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(app_2_consumption, app_2.getCurrentConsumption().getMemory());
+    assertEquals(app_3_consumption, app_3.getCurrentConsumption().getMemory());
 
     // Increase user-limit-factor from 1GB to 10GB (1% * 10 * 100GB = 10GB).
     // Pending for both user_0 and user_1 are still 1GB each, so user-limit-
@@ -3028,13 +3027,13 @@ public class TestLeafQueue {
         SchedulingMode.RESPECT_PARTITION_EXCLUSIVITY);
     // Next container goes to user_0's app_1, since it still wanted 1GB.
     assertEquals(1*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
     // user_0's apps:
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_1.getCurrentConsumption().getMemorySize());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(2*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(0*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(0*GB, app_3.getCurrentConsumption().getMemory());
 
     e.assignContainers(clusterResource, node_0,
         new ResourceLimits(clusterResource),
@@ -3042,12 +3041,12 @@ public class TestLeafQueue {
     // Last container goes to user_1's app_3, since it still wanted 1GB.
     // user_0's apps:
     assertEquals(0*GB, e.getTotalPendingResourcesConsideringUserLimit(
-        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemorySize());
-    assertEquals(1*GB, app_0.getCurrentConsumption().getMemorySize());
-    assertEquals(2*GB, app_1.getCurrentConsumption().getMemorySize());
+        clusterResource, RMNodeLabelsManager.NO_LABEL).getMemory());
+    assertEquals(1*GB, app_0.getCurrentConsumption().getMemory());
+    assertEquals(2*GB, app_1.getCurrentConsumption().getMemory());
     // user_1's apps:
-    assertEquals(2*GB, app_2.getCurrentConsumption().getMemorySize());
-    assertEquals(1*GB, app_3.getCurrentConsumption().getMemorySize());
+    assertEquals(2*GB, app_2.getCurrentConsumption().getMemory());
+    assertEquals(1*GB, app_3.getCurrentConsumption().getMemory());
 
     // Release each container from app_0
     for (RMContainer rmContainer : app_0.getLiveContainers()) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2f3e1d96/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 626acd8..bbf6e43 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
@@ -461,7 +461,7 @@ public class TestNodeLabelContainerAllocation {
 
     rm1.close();
   }
-
+  
   private void checkPendingResource(MockRM rm, int priority,
       ApplicationAttemptId attemptId, int memory) {
     CapacityScheduler cs = (CapacityScheduler) rm.getRMContext().getScheduler();
@@ -470,7 +470,7 @@ public class TestNodeLabelContainerAllocation {
         app.getAppSchedulingInfo().getResourceRequest(
             Priority.newInstance(priority), "*");
     Assert.assertEquals(memory,
-        rr.getCapability().getMemorySize() * rr.getNumContainers());
+        rr.getCapability().getMemory() * rr.getNumContainers());
   }
   
   private void checkLaunchedContainerNumOnNode(MockRM rm, NodeId nodeId,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2f3e1d96/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 e3c04f8..4a815f5 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
@@ -172,14 +172,14 @@ public class TestParentQueue {
   private float computeQueueAbsoluteUsedCapacity(CSQueue queue, 
       int expectedMemory, Resource clusterResource) {
     return (
-        ((float)expectedMemory / (float)clusterResource.getMemorySize())
+        ((float)expectedMemory / (float)clusterResource.getMemory())
       );
   }
   
   private float computeQueueUsedCapacity(CSQueue queue,
       int expectedMemory, Resource clusterResource) {
     return (expectedMemory / 
-        (clusterResource.getMemorySize() * queue.getAbsoluteCapacity()));
+        (clusterResource.getMemory() * queue.getAbsoluteCapacity()));
   }
   
   final static float DELTA = 0.0001f;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2f3e1d96/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 afdc6fc..9d2fa15 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
@@ -115,7 +115,7 @@ public class TestQueueCapacities {
   }
 
   void check(int mem, int cpu, Resource res) {
-    Assert.assertEquals(mem, res.getMemorySize());
+    Assert.assertEquals(mem, res.getMemory());
     Assert.assertEquals(cpu, res.getVirtualCores());
   }
 


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