hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [4/7] hadoop git commit: YARN-4844. Add getMemorySize/getVirtualCoresSize to o.a.h.y.api.records.Resource. (wangda)
Date Tue, 07 Jun 2016 19:42:39 GMT
http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.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/TestApplicationLimits.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/TestApplicationLimits.java
index 6c0d95f..43dd7ba 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/TestApplicationLimits.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/TestApplicationLimits.java
@@ -290,12 +290,12 @@ public class TestApplicationLimits {
     
     // Assert in metrics
     assertEquals(queue.getMetrics().getAMResourceLimitMB(),
-        amResourceLimit.getMemory());
+        amResourceLimit.getMemorySize());
     assertEquals(queue.getMetrics().getAMResourceLimitVCores(),
         amResourceLimit.getVirtualCores());
 
     assertEquals(
-        (int)(clusterResource.getMemory() * queue.getAbsoluteCapacity()),
+        (int)(clusterResource.getMemorySize() * queue.getAbsoluteCapacity()),
         queue.getMetrics().getAvailableMB()
         );
     
@@ -310,7 +310,7 @@ public class TestApplicationLimits {
       Resource.newInstance(96*GB, 1));
     
     assertEquals(
-        (int)(clusterResource.getMemory() * queue.getAbsoluteCapacity()),
+        (int)(clusterResource.getMemorySize() * queue.getAbsoluteCapacity()),
         queue.getMetrics().getAvailableMB()
         );
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationPriority.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/TestApplicationPriority.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/TestApplicationPriority.java
index 1569a12..2a1c642 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/TestApplicationPriority.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/TestApplicationPriority.java
@@ -171,13 +171,13 @@ public class TestApplicationPriority {
         7, 2 * GB, nm1);
 
     Assert.assertEquals(7, allocated1.size());
-    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
+    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemorySize());
 
     // check node report, 15 GB used (1 AM and 7 containers) and 1 GB available
     SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
         nm1.getNodeId());
-    Assert.assertEquals(15 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(1 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(15 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(1 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // Submit the second app App2 with priority 8 (Higher than App1)
     Priority appPriority2 = Priority.newInstance(8);
@@ -189,8 +189,8 @@ public class TestApplicationPriority {
 
     // check node report, 16 GB used and 0 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // get scheduler
     CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
@@ -210,8 +210,8 @@ public class TestApplicationPriority {
 
     // check node report, 12 GB used and 4 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(12 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(4 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(12 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(4 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // send updated request for App1
     am1.allocate("127.0.0.1", 2 * GB, 10, new ArrayList<ContainerId>());
@@ -226,8 +226,8 @@ public class TestApplicationPriority {
 
     // check node report, 16 GB used and 0 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     rm.stop();
   }
@@ -256,13 +256,13 @@ public class TestApplicationPriority {
         7, 1 * GB, nm1);
 
     Assert.assertEquals(7, allocated1.size());
-    Assert.assertEquals(1 * GB, allocated1.get(0).getResource().getMemory());
+    Assert.assertEquals(1 * GB, allocated1.get(0).getResource().getMemorySize());
 
     // check node report, 8 GB used (1 AM and 7 containers) and 0 GB available
     SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
         nm1.getNodeId());
-    Assert.assertEquals(8 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(8 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // Submit the second app App2 with priority 7
     Priority appPriority2 = Priority.newInstance(7);
@@ -287,8 +287,8 @@ public class TestApplicationPriority {
 
     // check node report, 1 GB used and 7 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(1 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(7 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(1 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(7 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     rm.stop();
   }
@@ -477,13 +477,13 @@ public class TestApplicationPriority {
         NUM_CONTAINERS, 2 * GB, nm1);
 
     Assert.assertEquals(7, allocated1.size());
-    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
+    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemorySize());
 
     // check node report, 15 GB used (1 AM and 7 containers) and 1 GB available
     SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
         nm1.getNodeId());
-    Assert.assertEquals(15 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(1 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(15 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(1 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // Submit the second app App2 with priority 8 (Higher than App1)
     Priority appPriority2 = Priority.newInstance(8);
@@ -495,8 +495,8 @@ public class TestApplicationPriority {
 
     // check node report, 16 GB used and 0 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // get scheduler
     CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
@@ -518,8 +518,8 @@ public class TestApplicationPriority {
 
     // check node report, 12 GB used and 4 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(12 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(4 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(12 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(4 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // add request for containers App1
     am1.allocate("127.0.0.1", 2 * GB, 10, new ArrayList<ContainerId>());
@@ -531,8 +531,8 @@ public class TestApplicationPriority {
     Assert.assertEquals(2, allocated2.size());
     // check node report, 16 GB used and 0 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(16 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // kill 1 more
     counter = 0;
@@ -548,8 +548,8 @@ public class TestApplicationPriority {
 
     // check node report, 14 GB used and 2 GB available
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(14 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(14 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // Change the priority of App1 to 3 (lowest)
     Priority appPriority3 = Priority.newInstance(3);
@@ -617,7 +617,7 @@ public class TestApplicationPriority {
     ResourceScheduler scheduler = rm1.getRMContext().getScheduler();
     LeafQueue defaultQueue =
         (LeafQueue) ((CapacityScheduler) scheduler).getQueue("default");
-    int memory = defaultQueue.getAMResourceLimit().getMemory() / 2;
+    int memory = (int) (defaultQueue.getAMResourceLimit().getMemorySize() / 2);
 
     // App-1 with priority 5 submitted and running
     Priority appPriority1 = Priority.newInstance(5);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.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/TestCapacityScheduler.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/TestCapacityScheduler.java
index af0d6c9..ca9a740 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/TestCapacityScheduler.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/TestCapacityScheduler.java
@@ -508,12 +508,12 @@ public class TestCapacityScheduler {
 
   private void checkApplicationResourceUsage(int expected, 
       Application application) {
-    Assert.assertEquals(expected, application.getUsedResources().getMemory());
+    Assert.assertEquals(expected, application.getUsedResources().getMemorySize());
   }
   
   private void checkNodeResourceUsage(int expected,
       org.apache.hadoop.yarn.server.resourcemanager.NodeManager node) {
-    Assert.assertEquals(expected, node.getUsed().getMemory());
+    Assert.assertEquals(expected, node.getUsed().getMemorySize());
     node.checkResourceUsage();
   }
 
@@ -562,14 +562,14 @@ public class TestCapacityScheduler {
     cs.handle(new NodeAddedSchedulerEvent(n1));
     cs.handle(new NodeAddedSchedulerEvent(n2));
 
-    Assert.assertEquals(6 * GB, cs.getClusterResource().getMemory());
+    Assert.assertEquals(6 * GB, cs.getClusterResource().getMemorySize());
 
     // reconnect n1 with downgraded memory
     n1 = MockNodes.newNodeInfo(0, MockNodes.newResource(2 * GB), 1);
     cs.handle(new NodeRemovedSchedulerEvent(n1));
     cs.handle(new NodeAddedSchedulerEvent(n1));
 
-    Assert.assertEquals(4 * GB, cs.getClusterResource().getMemory());
+    Assert.assertEquals(4 * GB, cs.getClusterResource().getMemorySize());
     cs.stop();
   }
 
@@ -830,8 +830,8 @@ public class TestCapacityScheduler {
     SchedulerNodeReport report_nm1 = rm.getResourceScheduler().getNodeReport(
         nm1.getNodeId());
     // check node report, 2 GB used and 2 GB available
-    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(2 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // add request for containers
     am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 2 * GB, 1, 1);
@@ -847,17 +847,17 @@ public class TestCapacityScheduler {
 
     List<Container> allocated1 = alloc1Response.getAllocatedContainers();
     Assert.assertEquals(1, allocated1.size());
-    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemory());
+    Assert.assertEquals(2 * GB, allocated1.get(0).getResource().getMemorySize());
     Assert.assertEquals(nm1.getNodeId(), allocated1.get(0).getNodeId());
     
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
     // check node report, 4 GB used and 0 GB available
-    Assert.assertEquals(0, report_nm1.getAvailableResource().getMemory());
-    Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());
+    Assert.assertEquals(0, report_nm1.getAvailableResource().getMemorySize());
+    Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemorySize());
 
     // check container is assigned with 2 GB.
     Container c1 = allocated1.get(0);
-    Assert.assertEquals(2 * GB, c1.getResource().getMemory());
+    Assert.assertEquals(2 * GB, c1.getResource().getMemorySize());
     
     // update node resource to 2 GB, so resource is over-consumed.
     Map<NodeId, ResourceOption> nodeResourceMap = 
@@ -872,7 +872,7 @@ public class TestCapacityScheduler {
     waitCount = 0;
     while (waitCount++ != 20) {
       report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-      if (report_nm1.getAvailableResource().getMemory() != 0) {
+      if (report_nm1.getAvailableResource().getMemorySize() != 0) {
         break;
       }
       LOG.info("Waiting for RMNodeResourceUpdateEvent to be handled... Tried "
@@ -880,8 +880,9 @@ public class TestCapacityScheduler {
       Thread.sleep(1000);
     }
     // Now, the used resource is still 4 GB, and available resource is minus value.
-    Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(-2 * GB, report_nm1.getAvailableResource().getMemory());
+    report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
+    Assert.assertEquals(4 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(-2 * GB, report_nm1.getAvailableResource().getMemorySize());
     
     // Check container can complete successfully in case of resource over-commitment.
     ContainerStatus containerStatus = BuilderUtils.newContainerStatus(
@@ -897,9 +898,9 @@ public class TestCapacityScheduler {
     Assert.assertEquals(1, attempt1.getJustFinishedContainers().size());
     Assert.assertEquals(1, am1.schedule().getCompletedContainersStatuses().size());
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
+    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemorySize());
     // As container return 2 GB back, the available resource becomes 0 again.
-    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(0 * GB, report_nm1.getAvailableResource().getMemorySize());
     
     // Verify no NPE is trigger in schedule after resource is updated.
     am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 3 * GB, 1, 1);
@@ -1836,16 +1837,16 @@ public class TestCapacityScheduler {
     assertEquals(1, newNumAppsA);
     assertEquals(2, newNumAppsRoot);
     // original consumption on a1
-    assertEquals(3 * GB, origOldA1.getResourcesUsed().getMemory());
+    assertEquals(3 * GB, origOldA1.getResourcesUsed().getMemorySize());
     assertEquals(1, origOldA1.getResourcesUsed().getvCores());
-    assertEquals(0, origNewA1.getResourcesUsed().getMemory()); // after the move
+    assertEquals(0, origNewA1.getResourcesUsed().getMemorySize()); // after the move
     assertEquals(0, origNewA1.getResourcesUsed().getvCores()); // after the move
     // app moved here with live containers
-    assertEquals(3 * GB, targetNewA2.getResourcesUsed().getMemory());
+    assertEquals(3 * GB, targetNewA2.getResourcesUsed().getMemorySize());
     assertEquals(1, targetNewA2.getResourcesUsed().getvCores());
     // it was empty before the move
     assertEquals(0, targetOldA2.getNumApplications());
-    assertEquals(0, targetOldA2.getResourcesUsed().getMemory());
+    assertEquals(0, targetOldA2.getResourcesUsed().getMemorySize());
     assertEquals(0, targetOldA2.getResourcesUsed().getvCores());
     // after the app moved here
     assertEquals(1, targetNewA2.getNumApplications());
@@ -1859,7 +1860,7 @@ public class TestCapacityScheduler {
     assertEquals(0, targetOldA2.getNumContainers());
     // 1 user with 3GB
     assertEquals(3 * GB, origOldA1.getUsers().getUsersList().get(0)
-        .getResourcesUsed().getMemory());
+        .getResourcesUsed().getMemorySize());
     // 1 user with 1 core
     assertEquals(1, origOldA1.getUsers().getUsersList().get(0)
         .getResourcesUsed().getvCores());
@@ -1867,7 +1868,7 @@ public class TestCapacityScheduler {
     assertEquals(0, origNewA1.getUsers().getUsersList().size());
     // 1 user with 3GB
     assertEquals(3 * GB, targetNewA2.getUsers().getUsersList().get(0)
-        .getResourcesUsed().getMemory());
+        .getResourcesUsed().getMemorySize());
     // 1 user with 1 core
     assertEquals(1, targetNewA2.getUsers().getUsersList().get(0)
         .getResourcesUsed().getvCores());
@@ -2215,8 +2216,8 @@ public class TestCapacityScheduler {
         rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
 
     // check node report
-    Assert.assertEquals(1 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(9 * GB, report_nm1.getAvailableResource().getMemory());
+    Assert.assertEquals(1 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(9 * GB, report_nm1.getAvailableResource().getMemorySize());
 
     // add request for containers
     am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, 1 * GB, 1, 1);
@@ -2315,19 +2316,19 @@ public class TestCapacityScheduler {
 
     assertEquals("max allocation in CS",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("max allocation for A1",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        conf.getMaximumAllocationPerQueue(A1).getMemory());
+        conf.getMaximumAllocationPerQueue(A1).getMemorySize());
     assertEquals("max allocation",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        conf.getMaximumAllocation().getMemory());
+        conf.getMaximumAllocation().getMemorySize());
 
     CSQueue rootQueue = cs.getRootQueue();
     CSQueue queueA = findQueue(rootQueue, A);
     CSQueue queueA1 = findQueue(queueA, A1);
     assertEquals("queue max allocation", ((LeafQueue) queueA1)
-        .getMaximumAllocation().getMemory(), 8192);
+        .getMaximumAllocation().getMemorySize(), 8192);
 
     setMaxAllocMb(conf, A1, 4096);
 
@@ -2410,19 +2411,19 @@ public class TestCapacityScheduler {
 
     assertEquals("max capability MB in CS",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("max capability vcores in CS",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
         cs.getMaximumResourceCapability().getVirtualCores());
     assertEquals("max allocation MB A1",
         4096,
-        conf.getMaximumAllocationPerQueue(A1).getMemory());
+        conf.getMaximumAllocationPerQueue(A1).getMemorySize());
     assertEquals("max allocation vcores A1",
         2,
         conf.getMaximumAllocationPerQueue(A1).getVirtualCores());
     assertEquals("cluster max allocation MB",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        conf.getMaximumAllocation().getMemory());
+        conf.getMaximumAllocation().getMemorySize());
     assertEquals("cluster max allocation vcores",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
         conf.getMaximumAllocation().getVirtualCores());
@@ -2431,7 +2432,7 @@ public class TestCapacityScheduler {
     CSQueue queueA = findQueue(rootQueue, A);
     CSQueue queueA1 = findQueue(queueA, A1);
     assertEquals("queue max allocation", ((LeafQueue) queueA1)
-        .getMaximumAllocation().getMemory(), 4096);
+        .getMaximumAllocation().getMemorySize(), 4096);
 
     setMaxAllocMb(conf, A1, 6144);
     setMaxAllocVcores(conf, A1, 3);
@@ -2439,22 +2440,22 @@ public class TestCapacityScheduler {
     // conf will have changed but we shouldn't be able to change max allocation
     // for the actual queue
     assertEquals("max allocation MB A1", 6144,
-        conf.getMaximumAllocationPerQueue(A1).getMemory());
+        conf.getMaximumAllocationPerQueue(A1).getMemorySize());
     assertEquals("max allocation vcores A1", 3,
         conf.getMaximumAllocationPerQueue(A1).getVirtualCores());
     assertEquals("max allocation MB cluster",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        conf.getMaximumAllocation().getMemory());
+        conf.getMaximumAllocation().getMemorySize());
     assertEquals("max allocation vcores cluster",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
         conf.getMaximumAllocation().getVirtualCores());
     assertEquals("queue max allocation MB", 6144,
-        ((LeafQueue) queueA1).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueA1).getMaximumAllocation().getMemorySize());
     assertEquals("queue max allocation vcores", 3,
         ((LeafQueue) queueA1).getMaximumAllocation().getVirtualCores());
     assertEquals("max capability MB cluster",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("cluster max capability vcores",
         YarnConfiguration.DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES,
         cs.getMaximumResourceCapability().getVirtualCores());
@@ -2479,7 +2480,7 @@ public class TestCapacityScheduler {
     checkQueueCapacities(cs, A_CAPACITY, B_CAPACITY);
 
     assertEquals("max allocation MB in CS", 10240,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("max allocation vcores in CS", 10,
         cs.getMaximumResourceCapability().getVirtualCores());
 
@@ -2525,7 +2526,7 @@ public class TestCapacityScheduler {
     checkQueueCapacities(cs, A_CAPACITY, B_CAPACITY);
 
     assertEquals("max allocation MB in CS", 10240,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("max allocation vcores in CS", 10,
         cs.getMaximumResourceCapability().getVirtualCores());
 
@@ -2537,15 +2538,15 @@ public class TestCapacityScheduler {
     CSQueue queueB2 = findQueue(queueB, B2);
 
     assertEquals("queue A1 max allocation MB", 4096,
-        ((LeafQueue) queueA1).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueA1).getMaximumAllocation().getMemorySize());
     assertEquals("queue A1 max allocation vcores", 4,
         ((LeafQueue) queueA1).getMaximumAllocation().getVirtualCores());
     assertEquals("queue A2 max allocation MB", 10240,
-        ((LeafQueue) queueA2).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueA2).getMaximumAllocation().getMemorySize());
     assertEquals("queue A2 max allocation vcores", 10,
         ((LeafQueue) queueA2).getMaximumAllocation().getVirtualCores());
     assertEquals("queue B2 max allocation MB", 10240,
-        ((LeafQueue) queueB2).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueB2).getMaximumAllocation().getMemorySize());
     assertEquals("queue B2 max allocation vcores", 10,
         ((LeafQueue) queueB2).getMaximumAllocation().getVirtualCores());
 
@@ -2555,19 +2556,19 @@ public class TestCapacityScheduler {
     // cluster level setting should change and any queues without
     // per queue setting
     assertEquals("max allocation MB in CS", 12288,
-        cs.getMaximumResourceCapability().getMemory());
+        cs.getMaximumResourceCapability().getMemorySize());
     assertEquals("max allocation vcores in CS", 12,
         cs.getMaximumResourceCapability().getVirtualCores());
     assertEquals("queue A1 max MB allocation", 4096,
-        ((LeafQueue) queueA1).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueA1).getMaximumAllocation().getMemorySize());
     assertEquals("queue A1 max vcores allocation", 4,
         ((LeafQueue) queueA1).getMaximumAllocation().getVirtualCores());
     assertEquals("queue A2 max MB allocation", 12288,
-        ((LeafQueue) queueA2).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueA2).getMaximumAllocation().getMemorySize());
     assertEquals("queue A2 max vcores allocation", 12,
         ((LeafQueue) queueA2).getMaximumAllocation().getVirtualCores());
     assertEquals("queue B2 max MB allocation", 12288,
-        ((LeafQueue) queueB2).getMaximumAllocation().getMemory());
+        ((LeafQueue) queueB2).getMaximumAllocation().getMemorySize());
     assertEquals("queue B2 max vcores allocation", 12,
         ((LeafQueue) queueB2).getMaximumAllocation().getVirtualCores());
   }
@@ -2614,7 +2615,7 @@ public class TestCapacityScheduler {
     // Maximum resoure of b1 is 100 * 0.895 * 0.792 = 71 GB
     // 2 GBs used by am, so it's 71 - 2 = 69G.
     Assert.assertEquals(69 * GB,
-        am1.doHeartbeat().getAvailableResources().getMemory());
+        am1.doHeartbeat().getAvailableResources().getMemorySize());
     
     RMApp app2 = rm1.submitApp(1 * GB, "app", "user", null, "b2");
     MockAM am2 = MockRM.launchAndRegisterAM(app2, rm1, nm1);
@@ -2630,7 +2631,7 @@ public class TestCapacityScheduler {
     // B1 uses 3 GB (2 * 1GB containers and 1 AM container)
     // Available is 100 - 41 - 3 = 56 GB
     Assert.assertEquals(56 * GB,
-        am1.doHeartbeat().getAvailableResources().getMemory());
+        am1.doHeartbeat().getAvailableResources().getMemorySize());
     
     // Now we submit app3 to a1 (in higher level hierarchy), to see if headroom
     // of app1 (in queue b1) updated correctly
@@ -2649,7 +2650,7 @@ public class TestCapacityScheduler {
     // A1 uses 25 GB (3 * 8GB containers and 1 AM container)
     // Available is 100 - 41 - 4 - 25 = 30 GB
     Assert.assertEquals(30 * GB,
-        am1.doHeartbeat().getAvailableResources().getMemory());
+        am1.doHeartbeat().getAvailableResources().getMemorySize());
   }
   
   @Test
@@ -2857,7 +2858,7 @@ public class TestCapacityScheduler {
         memory,
         queue.getQueueResourceUsage()
             .getPending(label == null ? RMNodeLabelsManager.NO_LABEL : label)
-            .getMemory());
+            .getMemorySize());
   }
 
   private void checkPendingResourceGreaterThanZero(MockRM rm, String queueName,
@@ -2866,7 +2867,7 @@ public class TestCapacityScheduler {
     CSQueue queue = cs.getQueue(queueName);
     Assert.assertTrue(queue.getQueueResourceUsage()
         .getPending(label == null ? RMNodeLabelsManager.NO_LABEL : label)
-        .getMemory() > 0);
+        .getMemorySize() > 0);
   }
 
   // Test verifies AM Used resource for LeafQueue when AM ResourceRequest is
@@ -3066,7 +3067,7 @@ public class TestCapacityScheduler {
             u0Priority, recordFactory)));
     cs.handle(new NodeUpdateSchedulerEvent(node));
     cs.handle(new NodeUpdateSchedulerEvent(node2));
-    assertEquals(6*GB, fiCaApp1.getHeadroom().getMemory());
+    assertEquals(6*GB, fiCaApp1.getHeadroom().getMemorySize());
     assertEquals(15, fiCaApp1.getHeadroom().getVirtualCores());
 
     // allocate container for app2 with 1GB memory and 1 vcore
@@ -3075,7 +3076,7 @@ public class TestCapacityScheduler {
             u0Priority, recordFactory)));
     cs.handle(new NodeUpdateSchedulerEvent(node));
     cs.handle(new NodeUpdateSchedulerEvent(node2));
-    assertEquals(9*GB, fiCaApp2.getHeadroom().getMemory());
+    assertEquals(9*GB, fiCaApp2.getHeadroom().getMemorySize());
     assertEquals(15, fiCaApp2.getHeadroom().getVirtualCores());
   }
 
@@ -3180,7 +3181,7 @@ public class TestCapacityScheduler {
     FiCaSchedulerApp app = getFiCaSchedulerApp(rm, app1.getApplicationId());
     
     Assert.assertEquals(2 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     checkPendingResource(rm, "a1", 2 * GB, null);
     checkPendingResource(rm, "a", 2 * GB, null);
     checkPendingResource(rm, "root", 2 * GB, null);
@@ -3194,7 +3195,7 @@ public class TestCapacityScheduler {
         null);
     
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     checkPendingResource(rm, "a1", 6 * GB, null);
     checkPendingResource(rm, "a", 6 * GB, null);
     checkPendingResource(rm, "root", 6 * GB, null);
@@ -3210,7 +3211,7 @@ public class TestCapacityScheduler {
                 .newInstance(containerId3, Resources.createResource(2 * GB))),
         null);
     Assert.assertEquals(4 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     checkPendingResource(rm, "a1", 4 * GB, null);
     checkPendingResource(rm, "a", 4 * GB, null);
     checkPendingResource(rm, "root", 4 * GB, null);
@@ -3228,10 +3229,10 @@ public class TestCapacityScheduler {
     Resource amResourceLimit = queueA.getAMResourceLimit();
 
     Resource amResource1 =
-        Resource.newInstance(amResourceLimit.getMemory() + 1024,
+        Resource.newInstance(amResourceLimit.getMemorySize() + 1024,
             amResourceLimit.getVirtualCores() + 1);
     Resource amResource2 =
-        Resource.newInstance(amResourceLimit.getMemory() + 2048,
+        Resource.newInstance(amResourceLimit.getMemorySize() + 2048,
             amResourceLimit.getVirtualCores() + 1);
 
     rm.submitApp(amResource1, "app-1", userName, null, queueName);
@@ -3351,23 +3352,26 @@ public class TestCapacityScheduler {
     application_0.schedule();
 
     // Check the used resource is 1 GB 1 core
-    Assert.assertEquals(1 * GB, nm_0.getUsed().getMemory());
+    Assert.assertEquals(1 * GB, nm_0.getUsed().getMemorySize());
     Resource usedResource =
         resourceManager.getResourceScheduler()
+
             .getSchedulerNode(nm_0.getNodeId()).getUsedResource();
-    Assert.assertEquals(usedResource.getMemory(), 1 * GB);
+    Assert.assertEquals(usedResource.getMemorySize(), 1 * GB);
+
     Assert.assertEquals(usedResource.getVirtualCores(), 1);
     // Check total resource of scheduler node is also changed to 1 GB 1 core
     Resource totalResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getTotalResource();
-    Assert.assertEquals(totalResource.getMemory(), 1 * GB);
+    Assert.assertEquals(totalResource.getMemorySize(), 1 * GB);
     Assert.assertEquals(totalResource.getVirtualCores(), 1);
     // Check the available resource is 0/0
     Resource availableResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getAvailableResource();
-    Assert.assertEquals(availableResource.getMemory(), 0);
+    Assert.assertEquals(availableResource.getMemorySize(), 0);
+
     Assert.assertEquals(availableResource.getVirtualCores(), 0);
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerNodeLabelUpdate.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/TestCapacitySchedulerNodeLabelUpdate.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/TestCapacitySchedulerNodeLabelUpdate.java
index cff79cd..0f69e73 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/TestCapacitySchedulerNodeLabelUpdate.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/TestCapacitySchedulerNodeLabelUpdate.java
@@ -111,7 +111,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     CapacityScheduler scheduler = (CapacityScheduler) rm.getResourceScheduler();
     CSQueue queue = scheduler.getQueue(queueName);
     Assert.assertEquals(memory, queue.getQueueResourceUsage().getUsed(label)
-        .getMemory());
+        .getMemorySize());
   }
 
   private void checkUsedCapacity(MockRM rm, String queueName, int capacity,
@@ -128,7 +128,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     CapacityScheduler scheduler = (CapacityScheduler) rm.getResourceScheduler();
     CSQueue queue = scheduler.getQueue(queueName);
     Assert.assertEquals(memory, queue.getQueueResourceUsage().getAMUsed(label)
-        .getMemory());
+        .getMemorySize());
   }
 
   private void checkUserUsedResource(MockRM rm, String queueName,
@@ -137,7 +137,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     LeafQueue queue = (LeafQueue) scheduler.getQueue(queueName);
     LeafQueue.User user = queue.getUser(userName);
     Assert.assertEquals(memory,
-        user.getResourceUsage().getUsed(partition).getMemory());
+        user.getResourceUsage().getUsed(partition).getMemorySize());
   }
 
   @Test(timeout = 60000)
@@ -175,7 +175,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
         rm.getResourceScheduler().getAppResourceUsageReport(
             am1.getApplicationAttemptId());
     Assert.assertEquals(1024, appResourceUsageReport.getUsedResources()
-        .getMemory());
+        .getMemorySize());
     Assert.assertEquals(1, appResourceUsageReport.getUsedResources()
         .getVirtualCores());
     // request a container.
@@ -186,7 +186,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
         rm.getResourceScheduler().getAppResourceUsageReport(
             am1.getApplicationAttemptId());
     Assert.assertEquals(2048, appResourceUsageReport.getUsedResources()
-        .getMemory());
+        .getMemorySize());
     Assert.assertEquals(2, appResourceUsageReport.getUsedResources()
         .getVirtualCores());
     LeafQueue queue =
@@ -196,7 +196,7 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     for (UserInfo userInfo : users) {
       if (userInfo.getUsername().equals("user")) {
         ResourceInfo resourcesUsed = userInfo.getResourcesUsed();
-        Assert.assertEquals(2048, resourcesUsed.getMemory());
+        Assert.assertEquals(2048, resourcesUsed.getMemorySize());
         Assert.assertEquals(2, resourcesUsed.getvCores());
       }
     }
@@ -271,9 +271,9 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "user", "x", 0);
     checkUserUsedResource(rm, "a", "user", "z", 1024);
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("x").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("x").getMemorySize());
     Assert.assertEquals(1024,
-        app.getAppAttemptResourceUsage().getUsed("z").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("z").getMemorySize());
     
     // change h1's label to y
     mgr.replaceLabelsOnNode(ImmutableMap.of(nm1.getNodeId(), toSet("y")));
@@ -296,11 +296,11 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "user", "y", 1024);
     checkUserUsedResource(rm, "a", "user", "z", 0);
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("x").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("x").getMemorySize());
     Assert.assertEquals(1024,
-        app.getAppAttemptResourceUsage().getUsed("y").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("y").getMemorySize());
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("z").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("z").getMemorySize());
     
     // change h1's label to no label
     Set<String> emptyLabels = new HashSet<>();
@@ -326,13 +326,13 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "user", "z", 0);
     checkUserUsedResource(rm, "a", "user", "", 2048);
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("x").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("x").getMemorySize());
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("y").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("y").getMemorySize());
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getUsed("z").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("z").getMemorySize());
     Assert.assertEquals(2048,
-        app.getAppAttemptResourceUsage().getUsed("").getMemory());
+        app.getAppAttemptResourceUsage().getUsed("").getMemorySize());
 
     // Finish the two containers, we should see used resource becomes 0
     cs.completedContainer(cs.getRMContainer(containerId2),
@@ -460,17 +460,17 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "u2", "z", 2 * GB);
     checkUserUsedResource(rm, "a", "u2", "", 1 * GB);
     Assert.assertEquals(0,
-        application1.getAppAttemptResourceUsage().getUsed("x").getMemory());
+        application1.getAppAttemptResourceUsage().getUsed("x").getMemorySize());
     Assert.assertEquals(1 * GB,
-        application1.getAppAttemptResourceUsage().getUsed("z").getMemory());
+        application1.getAppAttemptResourceUsage().getUsed("z").getMemorySize());
     Assert.assertEquals(2 * GB,
-        application1.getAppAttemptResourceUsage().getUsed("").getMemory());
+        application1.getAppAttemptResourceUsage().getUsed("").getMemorySize());
     Assert.assertEquals(0,
-        application2.getAppAttemptResourceUsage().getUsed("x").getMemory());
+        application2.getAppAttemptResourceUsage().getUsed("x").getMemorySize());
     Assert.assertEquals(2 * GB,
-        application2.getAppAttemptResourceUsage().getUsed("z").getMemory());
+        application2.getAppAttemptResourceUsage().getUsed("z").getMemorySize());
     Assert.assertEquals(1 * GB,
-        application2.getAppAttemptResourceUsage().getUsed("").getMemory());
+        application2.getAppAttemptResourceUsage().getUsed("").getMemorySize());
 
     rm.close();
   }
@@ -536,9 +536,9 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "user", "x", 0);
     checkUserUsedResource(rm, "a", "user", "z", 2048);
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getAMUsed("x").getMemory());
+        app.getAppAttemptResourceUsage().getAMUsed("x").getMemorySize());
     Assert.assertEquals(1024,
-        app.getAppAttemptResourceUsage().getAMUsed("z").getMemory());
+        app.getAppAttemptResourceUsage().getAMUsed("z").getMemorySize());
 
     // change h1's label to no label
     Set<String> emptyLabels = new HashSet<>();
@@ -555,11 +555,11 @@ public class TestCapacitySchedulerNodeLabelUpdate {
     checkUserUsedResource(rm, "a", "user", "z", 0);
     checkUserUsedResource(rm, "a", "user", "", 2048);
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getAMUsed("x").getMemory());
+        app.getAppAttemptResourceUsage().getAMUsed("x").getMemorySize());
     Assert.assertEquals(0,
-        app.getAppAttemptResourceUsage().getAMUsed("z").getMemory());
+        app.getAppAttemptResourceUsage().getAMUsed("z").getMemorySize());
     Assert.assertEquals(1024,
-        app.getAppAttemptResourceUsage().getAMUsed("").getMemory());
+        app.getAppAttemptResourceUsage().getAMUsed("").getMemorySize());
 
     rm.close();
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestChildQueueOrder.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/TestChildQueueOrder.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/TestChildQueueOrder.java
index 88c7c13..9213477 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/TestChildQueueOrder.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/TestChildQueueOrder.java
@@ -164,14 +164,14 @@ public class TestChildQueueOrder {
   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/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestContainerAllocation.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/TestContainerAllocation.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/TestContainerAllocation.java
index b5b2222..b4f434e 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/TestContainerAllocation.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/TestContainerAllocation.java
@@ -388,12 +388,12 @@ public class TestContainerAllocation {
     
     // NM1 has available resource = 2G (8G - 2 * 1G - 4G)
     Assert.assertEquals(2 * GB, cs.getNode(nm1.getNodeId())
-        .getAvailableResource().getMemory());
+        .getAvailableResource().getMemorySize());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Usage of queue = 4G + 2 * 1G + 4G (reserved)
     Assert.assertEquals(10 * GB, cs.getRootQueue().getQueueResourceUsage()
-        .getUsed().getMemory());
-    
+        .getUsed().getMemorySize());
+
     // Cancel asks of app2 and re-kick RM
     am2.allocate("*", 4 * GB, 0, new ArrayList<ContainerId>());
     cs.handle(new NodeUpdateSchedulerEvent(rmNode1));
@@ -401,10 +401,10 @@ public class TestContainerAllocation {
     // App2's reservation will be cancelled
     Assert.assertTrue(schedulerApp2.getReservedContainers().size() == 0);
     Assert.assertEquals(2 * GB, cs.getNode(nm1.getNodeId())
-        .getAvailableResource().getMemory());
+        .getAvailableResource().getMemorySize());
     Assert.assertNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     Assert.assertEquals(6 * GB, cs.getRootQueue().getQueueResourceUsage()
-        .getUsed().getMemory());
+        .getUsed().getMemorySize());
 
     rm1.close();
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestContainerResizing.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/TestContainerResizing.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/TestContainerResizing.java
index 9e29842..4900a1a 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/TestContainerResizing.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/TestContainerResizing.java
@@ -147,7 +147,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 2 * GB, null);
     Assert.assertEquals(2 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -157,7 +157,7 @@ public class TestContainerResizing {
     // Pending resource should be deducted
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     verifyContainerIncreased(am1.allocate(null, null), containerId1, 3 * GB);
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 17 * GB);
@@ -188,7 +188,7 @@ public class TestContainerResizing {
 
     checkUsedResource(rm1, "default", 3 * GB, null);
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     ContainerId containerId1 =
         ContainerId.newContainerId(am1.getApplicationAttemptId(), 1);
@@ -202,7 +202,7 @@ public class TestContainerResizing {
     verifyContainerDecreased(response, containerId1, 1 * GB);
     checkUsedResource(rm1, "default", 1 * GB, null);
     Assert.assertEquals(1 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     // Check if decreased containers added to RMNode
     RMNodeImpl rmNode =
@@ -272,7 +272,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -284,21 +284,21 @@ public class TestContainerResizing {
     /* Check reservation statuses */
     // Increase request should be reserved
     Assert.assertTrue(rmContainer1.hasIncreaseReservation());
-    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemory());
+    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemorySize());
     Assert.assertFalse(app.getReservedContainers().isEmpty());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 9 * GB, null);
     Assert.assertEquals(9 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
 
     // Complete one container and do another allocation
     am1.allocate(null, Arrays.asList(containerId2));
@@ -315,15 +315,15 @@ public class TestContainerResizing {
     // Pending resource will be changed since it's satisfied
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 7 * GB, null);
     Assert.assertEquals(7 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(7 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 1 * GB);
 
     rm1.close();
@@ -373,7 +373,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -390,15 +390,15 @@ public class TestContainerResizing {
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will *NOT* be updated
     checkUsedResource(rm1, "default", 3 * GB, null);
     Assert.assertEquals(3 * GB, ((LeafQueue) cs.getQueue("default"))
-            .getUser("user").getUsed().getMemory());
+            .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     rm1.close();
   }
 
@@ -453,7 +453,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -465,21 +465,21 @@ public class TestContainerResizing {
     /* Check reservation statuses */
     // Increase request should be reserved
     Assert.assertTrue(rmContainer1.hasIncreaseReservation());
-    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemory());
+    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemorySize());
     Assert.assertFalse(app.getReservedContainers().isEmpty());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 9 * GB, null);
     Assert.assertEquals(9 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
 
     // Complete one container and cancel increase request (via send a increase
     // request, make target_capacity=existing_capacity)
@@ -501,15 +501,15 @@ public class TestContainerResizing {
     // Pending resource will be changed since it's satisfied
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 1 * GB, null);
     Assert.assertEquals(1 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(1 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -565,7 +565,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -577,21 +577,21 @@ public class TestContainerResizing {
     /* Check reservation statuses */
     // Increase request should be reserved
     Assert.assertTrue(rmContainer1.hasIncreaseReservation());
-    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemory());
+    Assert.assertEquals(6 * GB, rmContainer1.getReservedResource().getMemorySize());
     Assert.assertFalse(app.getReservedContainers().isEmpty());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 10 * GB, null);
     Assert.assertEquals(10 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(4 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
 
     // Complete one container and cancel increase request (via send a increase
     // request, make target_capacity=existing_capacity)
@@ -611,15 +611,15 @@ public class TestContainerResizing {
     // Pending resource will be changed since it's satisfied
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 1 * GB, null);
     Assert.assertEquals(1 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(1 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -673,7 +673,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -685,21 +685,21 @@ public class TestContainerResizing {
     /* Check reservation statuses */
     // Increase request should be reserved
     Assert.assertTrue(rmContainer2.hasIncreaseReservation());
-    Assert.assertEquals(6 * GB, rmContainer2.getReservedResource().getMemory());
+    Assert.assertEquals(6 * GB, rmContainer2.getReservedResource().getMemorySize());
     Assert.assertFalse(app.getReservedContainers().isEmpty());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 9 * GB, null);
     Assert.assertEquals(9 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
 
     // Complete container2, container will be unreserved and completed
     am1.allocate(null, Arrays.asList(containerId2));
@@ -712,15 +712,15 @@ public class TestContainerResizing {
     // Pending resource will be changed since it's satisfied
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 1 * GB, null);
     Assert.assertEquals(1 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(1 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -771,7 +771,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // NM1 do 1 heartbeats
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -783,21 +783,21 @@ public class TestContainerResizing {
     /* Check reservation statuses */
     // Increase request should be reserved
     Assert.assertTrue(rmContainer2.hasIncreaseReservation());
-    Assert.assertEquals(6 * GB, rmContainer2.getReservedResource().getMemory());
+    Assert.assertEquals(6 * GB, rmContainer2.getReservedResource().getMemorySize());
     Assert.assertFalse(app.getReservedContainers().isEmpty());
     Assert.assertNotNull(cs.getNode(nm1.getNodeId()).getReservedContainer());
     // Pending resource will not be changed since it's not satisfied
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 9 * GB, null);
     Assert.assertEquals(9 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
 
     // Kill the application
     cs.handle(new AppAttemptRemovedSchedulerEvent(am1.getApplicationAttemptId(),
@@ -811,15 +811,15 @@ public class TestContainerResizing {
     // Pending resource will be changed since it's satisfied
     checkPendingResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 0 * GB, null);
     Assert.assertEquals(0 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -894,7 +894,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // Get rmNode1
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -916,15 +916,15 @@ public class TestContainerResizing {
     // There're still 3 pending increase requests
     checkPendingResource(rm1, "default", 3 * GB, null);
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 10 * GB, null);
     Assert.assertEquals(10 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(10 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -975,7 +975,7 @@ public class TestContainerResizing {
 
     checkPendingResource(rm1, "default", 6 * GB, null);
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
 
     // Get rmNode1
     CapacityScheduler cs = (CapacityScheduler) rm1.getResourceScheduler();
@@ -997,15 +997,15 @@ public class TestContainerResizing {
     // There're still 3 pending increase requests
     checkPendingResource(rm1, "default", 3 * GB, null);
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getPending().getMemory());
+        app.getAppAttemptResourceUsage().getPending().getMemorySize());
     // Queue/user/application's usage will be updated
     checkUsedResource(rm1, "default", 10 * GB, null);
     Assert.assertEquals(10 * GB, ((LeafQueue) cs.getQueue("default"))
-        .getUser("user").getUsed().getMemory());
+        .getUser("user").getUsed().getMemorySize());
     Assert.assertEquals(0 * GB,
-        app.getAppAttemptResourceUsage().getReserved().getMemory());
+        app.getAppAttemptResourceUsage().getReserved().getMemorySize());
     Assert.assertEquals(10 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
 
     rm1.close();
   }
@@ -1033,7 +1033,7 @@ public class TestContainerResizing {
     FiCaSchedulerApp app = TestUtils.getFiCaSchedulerApp(
         rm, app1.getApplicationId());
     Assert.assertEquals(3 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     // making sure container is launched
     ContainerId containerId1 =
         ContainerId.newContainerId(am1.getApplicationAttemptId(), 1);
@@ -1062,7 +1062,7 @@ public class TestContainerResizing {
     Assert.assertEquals(memory,
         queue.getQueueResourceUsage()
             .getPending(label == null ? RMNodeLabelsManager.NO_LABEL : label)
-            .getMemory());
+            .getMemorySize());
   }
 
   private void checkUsedResource(MockRM rm, String queueName, int memory,
@@ -1072,7 +1072,7 @@ public class TestContainerResizing {
     Assert.assertEquals(memory,
         queue.getQueueResourceUsage()
             .getUsed(label == null ? RMNodeLabelsManager.NO_LABEL : label)
-            .getMemory());
+            .getMemorySize());
   }
 
   private void verifyContainerIncreased(AllocateResponse response,
@@ -1082,7 +1082,7 @@ public class TestContainerResizing {
     for (Container c : increasedContainers) {
       if (c.getId().equals(containerId)) {
         found = true;
-        Assert.assertEquals(mem, c.getResource().getMemory());
+        Assert.assertEquals(mem, c.getResource().getMemorySize());
       }
     }
     if (!found) {
@@ -1097,7 +1097,7 @@ public class TestContainerResizing {
     for (Container c : decreasedContainers) {
       if (c.getId().equals(containerId)) {
         found = true;
-        Assert.assertEquals(mem, c.getResource().getMemory());
+        Assert.assertEquals(mem, c.getResource().getMemorySize());
       }
     }
     if (!found) {
@@ -1120,7 +1120,7 @@ public class TestContainerResizing {
       int expectedMemory) {
     CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
     SchedulerNode node = cs.getNode(nodeId);
-    Assert
-        .assertEquals(expectedMemory, node.getAvailableResource().getMemory());
+    Assert.assertEquals(expectedMemory,
+        node.getAvailableResource().getMemorySize());
   }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/19e57887/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestIncreaseAllocationExpirer.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/TestIncreaseAllocationExpirer.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/TestIncreaseAllocationExpirer.java
index d7ac0b2..cb698ec 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/TestIncreaseAllocationExpirer.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/TestIncreaseAllocationExpirer.java
@@ -98,7 +98,7 @@ public class TestIncreaseAllocationExpirer {
     FiCaSchedulerApp app = TestUtils.getFiCaSchedulerApp(
         rm1, app1.getApplicationId());
     Assert.assertEquals(2 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 18 * GB);
     // Report container status
     nm1.nodeHeartbeat(
@@ -129,11 +129,11 @@ public class TestIncreaseAllocationExpirer {
     // Verify container size is 3G
     Assert.assertEquals(
         3 * GB, rm1.getResourceScheduler().getRMContainer(containerId2)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     // Verify total resource usage
     checkUsedResource(rm1, "default", 4 * GB, null);
     Assert.assertEquals(4 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     // Verify available resource
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 16 * GB);
     rm1.stop();
@@ -172,7 +172,7 @@ public class TestIncreaseAllocationExpirer {
     FiCaSchedulerApp app = TestUtils.getFiCaSchedulerApp(
         rm1, app1.getApplicationId());
     Assert.assertEquals(2 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 18 * GB);
     nm1.nodeHeartbeat(
         app1.getCurrentAppAttempt()
@@ -190,7 +190,7 @@ public class TestIncreaseAllocationExpirer {
     // Verify resource usage
     checkUsedResource(rm1, "default", 4 * GB, null);
     Assert.assertEquals(4 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 16 * GB);
     // Wait long enough for the increase token to expire, and for the roll
     // back action to complete
@@ -198,11 +198,11 @@ public class TestIncreaseAllocationExpirer {
     // Verify container size is 1G
     Assert.assertEquals(
         1 * GB, rm1.getResourceScheduler().getRMContainer(containerId2)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     // Verify total resource usage is 2G
     checkUsedResource(rm1, "default", 2 * GB, null);
     Assert.assertEquals(2 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     // Verify available resource is rolled back to 18GB
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 18 * GB);
     rm1.stop();
@@ -276,7 +276,7 @@ public class TestIncreaseAllocationExpirer {
     FiCaSchedulerApp app = TestUtils.getFiCaSchedulerApp(
         rm1, app1.getApplicationId());
     Assert.assertEquals(6 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     // Verify available resource is now reduced to 14GB
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 14 * GB);
     // Use the first token (3G)
@@ -287,11 +287,11 @@ public class TestIncreaseAllocationExpirer {
     // Verify container size is rolled back to 3G
     Assert.assertEquals(
         3 * GB, rm1.getResourceScheduler().getRMContainer(containerId2)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     // Verify total resource usage is 4G
     checkUsedResource(rm1, "default", 4 * GB, null);
     Assert.assertEquals(4 * GB,
-        app.getAppAttemptResourceUsage().getUsed().getMemory());
+        app.getAppAttemptResourceUsage().getUsed().getMemorySize());
     // Verify available resource is rolled back to 14GB
     verifyAvailableResourceOfSchedulerNode(rm1, nm1.getNodeId(), 16 * GB);
     // Verify NM receives the decrease message (3G)
@@ -299,7 +299,7 @@ public class TestIncreaseAllocationExpirer {
         nm1.nodeHeartbeat(true).getContainersToDecrease();
     Assert.assertEquals(1, containersToDecrease.size());
     Assert.assertEquals(
-        3 * GB, containersToDecrease.get(0).getResource().getMemory());
+        3 * GB, containersToDecrease.get(0).getResource().getMemorySize());
     rm1.stop();
   }
 
@@ -394,13 +394,13 @@ public class TestIncreaseAllocationExpirer {
     Thread.sleep(10000);
     Assert.assertEquals(
         2 * GB, rm1.getResourceScheduler().getRMContainer(containerId2)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     Assert.assertEquals(
         3 * GB, rm1.getResourceScheduler().getRMContainer(containerId3)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     Assert.assertEquals(
         4 * GB, rm1.getResourceScheduler().getRMContainer(containerId4)
-            .getAllocatedResource().getMemory());
+            .getAllocatedResource().getMemorySize());
     // Verify NM receives 2 decrease message
     List<Container> containersToDecrease =
         nm1.nodeHeartbeat(true).getContainersToDecrease();
@@ -408,9 +408,9 @@ public class TestIncreaseAllocationExpirer {
     // Sort the list to make sure containerId3 is the first
     Collections.sort(containersToDecrease);
     Assert.assertEquals(
-        3 * GB, containersToDecrease.get(0).getResource().getMemory());
+        3 * GB, containersToDecrease.get(0).getResource().getMemorySize());
     Assert.assertEquals(
-        4 * GB, containersToDecrease.get(1).getResource().getMemory());
+        4 * GB, containersToDecrease.get(1).getResource().getMemorySize());
     rm1.stop();
   }
 
@@ -421,7 +421,7 @@ public class TestIncreaseAllocationExpirer {
     Assert.assertEquals(memory,
         queue.getQueueResourceUsage()
             .getUsed(label == null ? RMNodeLabelsManager.NO_LABEL : label)
-            .getMemory());
+            .getMemorySize());
   }
 
   private void verifyAvailableResourceOfSchedulerNode(MockRM rm, NodeId nodeId,
@@ -429,7 +429,7 @@ public class TestIncreaseAllocationExpirer {
     CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
     SchedulerNode node = cs.getNode(nodeId);
     Assert
-        .assertEquals(expectedMemory, node.getAvailableResource().getMemory());
+        .assertEquals(expectedMemory, node.getAvailableResource().getMemorySize());
   }
 
   private Container getContainer(


---------------------------------------------------------------------
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