hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [1/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:36 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 333490ba4 -> 19e578870


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/fair/TestFairScheduler.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
index 469d97b..06bbfe9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairScheduler.java
@@ -228,10 +228,10 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     Assert.assertEquals(10, scheduler.continuousSchedulingSleepMs);
     Assert.assertEquals(5000, scheduler.nodeLocalityDelayMs);
     Assert.assertEquals(5000, scheduler.rackLocalityDelayMs);
-    Assert.assertEquals(1024, scheduler.getMaximumResourceCapability().getMemory());
-    Assert.assertEquals(512, scheduler.getMinimumResourceCapability().getMemory());
+    Assert.assertEquals(1024, scheduler.getMaximumResourceCapability().getMemorySize());
+    Assert.assertEquals(512, scheduler.getMinimumResourceCapability().getMemorySize());
     Assert.assertEquals(128, 
-      scheduler.getIncrementResourceCapability().getMemory());
+      scheduler.getIncrementResourceCapability().getMemorySize());
   }
   
   @Test  
@@ -246,9 +246,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
       FairSchedulerConfiguration.RM_SCHEDULER_INCREMENT_ALLOCATION_VCORES, 2);
     scheduler.init(conf);
     scheduler.reinitialize(conf, null);
-    Assert.assertEquals(256, scheduler.getMinimumResourceCapability().getMemory());
+    Assert.assertEquals(256, scheduler.getMinimumResourceCapability().getMemorySize());
     Assert.assertEquals(1, scheduler.getMinimumResourceCapability().getVirtualCores());
-    Assert.assertEquals(512, scheduler.getIncrementResourceCapability().getMemory());
+    Assert.assertEquals(512, scheduler.getIncrementResourceCapability().getMemorySize());
     Assert.assertEquals(2, scheduler.getIncrementResourceCapability().getVirtualCores());
   }  
   
@@ -264,9 +264,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
       FairSchedulerConfiguration.RM_SCHEDULER_INCREMENT_ALLOCATION_VCORES, 2);
     scheduler.init(conf);
     scheduler.reinitialize(conf, null);
-    Assert.assertEquals(0, scheduler.getMinimumResourceCapability().getMemory());
+    Assert.assertEquals(0, scheduler.getMinimumResourceCapability().getMemorySize());
     Assert.assertEquals(0, scheduler.getMinimumResourceCapability().getVirtualCores());
-    Assert.assertEquals(512, scheduler.getIncrementResourceCapability().getMemory());
+    Assert.assertEquals(512, scheduler.getIncrementResourceCapability().getMemorySize());
     Assert.assertEquals(2, scheduler.getIncrementResourceCapability().getVirtualCores());
   }  
   
@@ -282,19 +282,19 @@ public class TestFairScheduler extends FairSchedulerTestBase {
             .newNodeInfo(1, Resources.createResource(1024), 1, "127.0.0.1");
     NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node1);
     scheduler.handle(nodeEvent1);
-    assertEquals(1024, scheduler.getClusterResource().getMemory());
+    assertEquals(1024, scheduler.getClusterResource().getMemorySize());
 
     // Add another node
     RMNode node2 =
         MockNodes.newNodeInfo(1, Resources.createResource(512), 2, "127.0.0.2");
     NodeAddedSchedulerEvent nodeEvent2 = new NodeAddedSchedulerEvent(node2);
     scheduler.handle(nodeEvent2);
-    assertEquals(1536, scheduler.getClusterResource().getMemory());
+    assertEquals(1536, scheduler.getClusterResource().getMemorySize());
 
     // Remove the first node
     NodeRemovedSchedulerEvent nodeEvent3 = new NodeRemovedSchedulerEvent(node1);
     scheduler.handle(nodeEvent3);
-    assertEquals(512, scheduler.getClusterResource().getMemory());
+    assertEquals(512, scheduler.getClusterResource().getMemorySize());
   }
 
   @Test
@@ -325,9 +325,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     
     // Divided three ways - between the two queues and the default queue
     for (FSLeafQueue p : queues) {
-      assertEquals(3414, p.getFairShare().getMemory());
+      assertEquals(3414, p.getFairShare().getMemorySize());
       assertEquals(3414, p.getMetrics().getFairShareMB());
-      assertEquals(3414, p.getSteadyFairShare().getMemory());
+      assertEquals(3414, p.getSteadyFairShare().getMemorySize());
       assertEquals(3414, p.getMetrics().getSteadyFairShareMB());
     }
   }
@@ -373,11 +373,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     FSLeafQueue queue = scheduler.getQueueManager().getLeafQueue(
         "queueA", false);
     // queueA's weight is 0.25, so its fair share should be 2 * 1024.
-    assertEquals(2 * 1024, queue.getFairShare().getMemory());
+    assertEquals(2 * 1024, queue.getFairShare().getMemorySize());
     // queueB's weight is 0.75, so its fair share should be 6 * 1024.
     queue = scheduler.getQueueManager().getLeafQueue(
         "queueB", false);
-    assertEquals(6 * 1024, queue.getFairShare().getMemory());
+    assertEquals(6 * 1024, queue.getFairShare().getMemorySize());
   }
 
   @Test
@@ -417,11 +417,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     FSLeafQueue queue = scheduler.getQueueManager().getLeafQueue(
         "queueA", false);
     // queueA's weight is 0.0, so its fair share should be 0.
-    assertEquals(0, queue.getFairShare().getMemory());
+    assertEquals(0, queue.getFairShare().getMemorySize());
     // queueB's weight is 0.0, so its fair share should be 0.
     queue = scheduler.getQueueManager().getLeafQueue(
         "queueB", false);
-    assertEquals(0, queue.getFairShare().getMemory());
+    assertEquals(0, queue.getFairShare().getMemorySize());
   }
 
   @Test
@@ -465,12 +465,12 @@ public class TestFairScheduler extends FairSchedulerTestBase {
         "queueA", false);
     // queueA's weight is 0.0 and minResources is 1,
     // so its fair share should be 1 (minShare).
-    assertEquals(1, queue.getFairShare().getMemory());
+    assertEquals(1, queue.getFairShare().getMemorySize());
     // queueB's weight is 0.0 and minResources is 1,
     // so its fair share should be 1 (minShare).
     queue = scheduler.getQueueManager().getLeafQueue(
         "queueB", false);
-    assertEquals(1, queue.getFairShare().getMemory());
+    assertEquals(1, queue.getFairShare().getMemorySize());
   }
 
   @Test
@@ -515,12 +515,12 @@ public class TestFairScheduler extends FairSchedulerTestBase {
         "queueA", false);
     // queueA's weight is 0.5 and minResources is 1024,
     // so its fair share should be 4096.
-    assertEquals(4096, queue.getFairShare().getMemory());
+    assertEquals(4096, queue.getFairShare().getMemorySize());
     // queueB's weight is 0.5 and minResources is 1024,
     // so its fair share should be 4096.
     queue = scheduler.getQueueManager().getLeafQueue(
         "queueB", false);
-    assertEquals(4096, queue.getFairShare().getMemory());
+    assertEquals(4096, queue.getFairShare().getMemorySize());
   }
 
   @Test
@@ -614,17 +614,17 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     FSLeafQueue queue1 = queueManager.getLeafQueue("default", true);
     FSLeafQueue queue2 = queueManager.getLeafQueue("parent.queue2", true);
     FSLeafQueue queue3 = queueManager.getLeafQueue("parent.queue3", true);
-    assertEquals(capacity / 2, queue1.getFairShare().getMemory());
+    assertEquals(capacity / 2, queue1.getFairShare().getMemorySize());
     assertEquals(capacity / 2, queue1.getMetrics().getFairShareMB());
-    assertEquals(capacity / 2, queue1.getSteadyFairShare().getMemory());
+    assertEquals(capacity / 2, queue1.getSteadyFairShare().getMemorySize());
     assertEquals(capacity / 2, queue1.getMetrics().getSteadyFairShareMB());
-    assertEquals(capacity / 4, queue2.getFairShare().getMemory());
+    assertEquals(capacity / 4, queue2.getFairShare().getMemorySize());
     assertEquals(capacity / 4, queue2.getMetrics().getFairShareMB());
-    assertEquals(capacity / 4, queue2.getSteadyFairShare().getMemory());
+    assertEquals(capacity / 4, queue2.getSteadyFairShare().getMemorySize());
     assertEquals(capacity / 4, queue2.getMetrics().getSteadyFairShareMB());
-    assertEquals(capacity / 4, queue3.getFairShare().getMemory());
+    assertEquals(capacity / 4, queue3.getFairShare().getMemorySize());
     assertEquals(capacity / 4, queue3.getMetrics().getFairShareMB());
-    assertEquals(capacity / 4, queue3.getSteadyFairShare().getMemory());
+    assertEquals(capacity / 4, queue3.getSteadyFairShare().getMemorySize());
     assertEquals(capacity / 4, queue3.getMetrics().getSteadyFairShareMB());
   }
 
@@ -725,13 +725,13 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals(
         FairSchedulerConfiguration.DEFAULT_RM_SCHEDULER_INCREMENT_ALLOCATION_MB,
         scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     NodeUpdateSchedulerEvent updateEvent2 = new NodeUpdateSchedulerEvent(node2);
     scheduler.handle(updateEvent2);
 
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue1").
-      getResourceUsage().getMemory());
+      getResourceUsage().getMemorySize());
     assertEquals(2, scheduler.getQueueManager().getQueue("queue1").
       getResourceUsage().getVirtualCores());
 
@@ -768,7 +768,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 1 is allocated app capacity
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue1").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     // Now queue 2 requests likewise
     ApplicationAttemptId attId = createSchedulingRequest(1024, "queue2", "user1", 1);
@@ -778,8 +778,8 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 2 is waiting with a reservation
     assertEquals(0, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
-    assertEquals(1024, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemory());
+        getResourceUsage().getMemorySize());
+    assertEquals(1024, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemorySize());
 
     // Now another node checks in with capacity
     RMNode node2 =
@@ -792,13 +792,13 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure this goes to queue 2
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     // The old reservation should still be there...
-    assertEquals(1024, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemory());
+    assertEquals(1024, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemorySize());
     // ... but it should disappear when we update the first node.
     scheduler.handle(updateEvent);
-    assertEquals(0, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemory());
+    assertEquals(0, scheduler.getSchedulerApp(attId).getCurrentReservation().getMemorySize());
 
   }
 
@@ -842,7 +842,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Verify capacity allocation
     assertEquals(6144, scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     // Create new app with a resource request that can be satisfied by any
     // node but would be
@@ -874,7 +874,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(new NodeUpdateSchedulerEvent(node4));
     assertEquals(8192, scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     scheduler.handle(new NodeUpdateSchedulerEvent(node1));
     scheduler.handle(new NodeUpdateSchedulerEvent(node2));
@@ -935,7 +935,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Verify capacity allocation
     assertEquals(8192, scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     // Create new app with a resource request that can be satisfied by any
     // node but would be
@@ -980,7 +980,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(new NodeUpdateSchedulerEvent(node4));
     assertEquals(10240, scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     scheduler.handle(new NodeUpdateSchedulerEvent(node1));
     scheduler.handle(new NodeUpdateSchedulerEvent(node2));
@@ -1024,7 +1024,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Verify capacity allocation
     assertEquals(8192, scheduler.getQueueManager().getQueue("queue1").
-            getResourceUsage().getMemory());
+            getResourceUsage().getMemorySize());
 
     // Verify number of reservations have decremented
     assertEquals(0,
@@ -1068,7 +1068,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 1 is allocated app capacity
     assertEquals(2048, scheduler.getQueueManager().getQueue("queue1").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     // Now queue 2 requests likewise
     createSchedulingRequest(1024, "queue2", "user2", 1);
@@ -1077,7 +1077,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 2 is allocated app capacity
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId1 = createSchedulingRequest(1024, "queue1", "user1", 1);
     scheduler.update();
@@ -1086,7 +1086,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Ensure the reservation does not get created as allocated memory of
     // queue1 exceeds max
     assertEquals(0, scheduler.getSchedulerApp(attId1).
-        getCurrentReservation().getMemory());
+        getCurrentReservation().getMemorySize());
   }
 
     @Test (timeout = 500000)
@@ -1125,7 +1125,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 1 is allocated app capacity
     assertEquals(2048, scheduler.getQueueManager().getQueue("queue1").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     // Now queue 2 requests likewise
     createSchedulingRequest(1024, "queue2", "user2", 1);
@@ -1134,7 +1134,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 2 is allocated app capacity
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue2").
-      getResourceUsage().getMemory());
+      getResourceUsage().getMemorySize());
     
     ApplicationAttemptId attId1 = createSchedulingRequest(1024, "queue1", "user1", 1);
     scheduler.update();
@@ -1142,7 +1142,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 1 is waiting with a reservation
     assertEquals(1024, scheduler.getSchedulerApp(attId1)
-        .getCurrentReservation().getMemory());
+        .getCurrentReservation().getMemorySize());
 
     // Exercise checks that reservation fits
     scheduler.handle(updateEvent);
@@ -1150,7 +1150,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Ensure the reservation still exists as allocated memory of queue1 doesn't
     // exceed max
     assertEquals(1024, scheduler.getSchedulerApp(attId1).
-        getCurrentReservation().getMemory());
+        getCurrentReservation().getMemorySize());
 
     // Now reduce max Resources of queue1 down to 2048
     out = new PrintWriter(new FileWriter(ALLOC_FILE));
@@ -1174,12 +1174,12 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure allocated memory of queue1 doesn't exceed its maximum
     assertEquals(2048, scheduler.getQueueManager().getQueue("queue1").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
     //the reservation of queue1 should be reclaim
     assertEquals(0, scheduler.getSchedulerApp(attId1).
-        getCurrentReservation().getMemory());
+        getCurrentReservation().getMemorySize());
     assertEquals(1024, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
   }
 
   @Test
@@ -1219,7 +1219,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 1 is allocated app capacity
     assertEquals(4096, scheduler.getQueueManager().getQueue("queue1").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
 
     // Now queue 2 requests below threshold
     ApplicationAttemptId attId = createSchedulingRequest(1024, "queue2", "user1", 1);
@@ -1228,7 +1228,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 2 has no reservation
     assertEquals(0, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
     assertEquals(0,
         scheduler.getSchedulerApp(attId).getReservedContainers().size());
 
@@ -1239,7 +1239,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // Make sure queue 2 is waiting with a reservation
     assertEquals(0, scheduler.getQueueManager().getQueue("queue2").
-        getResourceUsage().getMemory());
+        getResourceUsage().getMemorySize());
     assertEquals(3, scheduler.getSchedulerApp(attId).getCurrentReservation()
         .getVirtualCores());
 
@@ -1452,10 +1452,10 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     for (FSLeafQueue p : queues) {
       if (p.getName().equals("root.queueA")) {
-        assertEquals(1024, p.getFairShare().getMemory());
+        assertEquals(1024, p.getFairShare().getMemorySize());
       }
       else if (p.getName().equals("root.queueB")) {
-        assertEquals(2048, p.getFairShare().getMemory());
+        assertEquals(2048, p.getFairShare().getMemorySize());
       }
     }
   }
@@ -1544,9 +1544,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
       if (leaf.getName().equals("root.parentq.user1")
           || leaf.getName().equals("root.parentq.user2")) {
         // assert that the fair share is 1/4th node1's capacity
-        assertEquals(capacity / 4, leaf.getFairShare().getMemory());
+        assertEquals(capacity / 4, leaf.getFairShare().getMemorySize());
         // assert that the steady fair share is 1/4th node1's capacity
-        assertEquals(capacity / 4, leaf.getSteadyFairShare().getMemory());
+        assertEquals(capacity / 4, leaf.getSteadyFairShare().getMemorySize());
         // assert weights are equal for both the user queues
         assertEquals(1.0, leaf.getWeights().getWeight(ResourceType.MEMORY), 0);
       }
@@ -1580,9 +1580,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // The steady fair share for all queues should be 0
     QueueManager queueManager = scheduler.getQueueManager();
     assertEquals(0, queueManager.getLeafQueue("child1", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(0, queueManager.getLeafQueue("child2", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
 
     // Add one node
     RMNode node1 =
@@ -1590,13 +1590,13 @@ public class TestFairScheduler extends FairSchedulerTestBase {
             .newNodeInfo(1, Resources.createResource(6144), 1, "127.0.0.1");
     NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node1);
     scheduler.handle(nodeEvent1);
-    assertEquals(6144, scheduler.getClusterResource().getMemory());
+    assertEquals(6144, scheduler.getClusterResource().getMemorySize());
 
     // The steady fair shares for all queues should be updated
     assertEquals(2048, queueManager.getLeafQueue("child1", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(2048, queueManager.getLeafQueue("child2", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
 
     // Reload the allocation configuration file
     out = new PrintWriter(new FileWriter(ALLOC_FILE));
@@ -1621,20 +1621,20 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     // The steady fair shares for all queues should be updated
     assertEquals(1024, queueManager.getLeafQueue("child1", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(2048, queueManager.getLeafQueue("child2", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(2048, queueManager.getLeafQueue("child3", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
 
     // Remove the node, steady fair shares should back to 0
     NodeRemovedSchedulerEvent nodeEvent2 = new NodeRemovedSchedulerEvent(node1);
     scheduler.handle(nodeEvent2);
-    assertEquals(0, scheduler.getClusterResource().getMemory());
+    assertEquals(0, scheduler.getClusterResource().getMemorySize());
     assertEquals(0, queueManager.getLeafQueue("child1", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(0, queueManager.getLeafQueue("child2", false)
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
   }
 
   @Test
@@ -1652,19 +1652,19 @@ public class TestFairScheduler extends FairSchedulerTestBase {
             .newNodeInfo(1, Resources.createResource(6144), 1, "127.0.0.1");
     NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node1);
     scheduler.handle(nodeEvent1);
-    assertEquals(6144, scheduler.getClusterResource().getMemory());
+    assertEquals(6144, scheduler.getClusterResource().getMemorySize());
     assertEquals(6144, scheduler.getQueueManager().getRootQueue()
-        .getSteadyFairShare().getMemory());
+        .getSteadyFairShare().getMemorySize());
     assertEquals(6144, scheduler.getQueueManager()
-        .getLeafQueue("default", false).getSteadyFairShare().getMemory());
+        .getLeafQueue("default", false).getSteadyFairShare().getMemorySize());
 
     // Submit one application
     ApplicationAttemptId appAttemptId1 = createAppAttemptId(1, 1);
     createApplicationWithAMResource(appAttemptId1, "default", "user1", null);
     assertEquals(3072, scheduler.getQueueManager()
-        .getLeafQueue("default", false).getSteadyFairShare().getMemory());
+        .getLeafQueue("default", false).getSteadyFairShare().getMemorySize());
     assertEquals(3072, scheduler.getQueueManager()
-        .getLeafQueue("user1", false).getSteadyFairShare().getMemory());
+        .getLeafQueue("user1", false).getSteadyFairShare().getMemorySize());
   }
 
   /**
@@ -1720,10 +1720,10 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
 
     assertEquals(2 * minReqSize, scheduler.getQueueManager().getQueue("root.queue1")
-        .getDemand().getMemory());
+        .getDemand().getMemorySize());
     assertEquals(2 * minReqSize + 2 * minReqSize + (2 * minReqSize), scheduler
         .getQueueManager().getQueue("root.queue2").getDemand()
-        .getMemory());
+        .getMemorySize());
   }
 
   @Test
@@ -2034,7 +2034,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     Resource toPreempt = scheduler.resourceDeficit(scheduler.getQueueManager()
             .getLeafQueue("queueA.queueA2", false), clock.getTime());
-    assertEquals(3277, toPreempt.getMemory());
+    assertEquals(3277, toPreempt.getMemorySize());
 
     // verify if the 3 containers required by queueA2 are preempted in the same
     // round
@@ -2162,18 +2162,18 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // share.
     clock.tickSec(6);
     assertEquals(
-        1024, scheduler.resourceDeficit(schedC, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(schedC, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(schedD, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(schedD, clock.getTime()).getMemorySize());
 
     // After fairSharePreemptionTime has passed, they should want to preempt
     // fair share.
     scheduler.update();
     clock.tickSec(6);
     assertEquals(
-        1536 , scheduler.resourceDeficit(schedC, clock.getTime()).getMemory());
+        1536 , scheduler.resourceDeficit(schedC, clock.getTime()).getMemorySize());
     assertEquals(
-        1536, scheduler.resourceDeficit(schedD, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(schedD, clock.getTime()).getMemorySize());
   }
 
   @Test
@@ -2301,12 +2301,12 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // share.
     clock.tickSec(6);
     Resource res = scheduler.resourceDeficit(schedC, clock.getTime());
-    assertEquals(1024, res.getMemory());
+    assertEquals(1024, res.getMemorySize());
     // Demand = 3
     assertEquals(3, res.getVirtualCores());
 
     res = scheduler.resourceDeficit(schedD, clock.getTime());
-    assertEquals(1024, res.getMemory());
+    assertEquals(1024, res.getMemorySize());
     // Demand = 6, but min share = 2
     assertEquals(2, res.getVirtualCores());
 
@@ -2315,11 +2315,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     clock.tickSec(6);
     res = scheduler.resourceDeficit(schedC, clock.getTime());
-    assertEquals(1536, res.getMemory());
+    assertEquals(1536, res.getMemorySize());
     assertEquals(3, res.getVirtualCores());
 
     res = scheduler.resourceDeficit(schedD, clock.getTime());
-    assertEquals(1536, res.getMemory());
+    assertEquals(1536, res.getMemorySize());
     // Demand = 6, but fair share = 3
     assertEquals(3, res.getVirtualCores());
   }
@@ -2448,61 +2448,61 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     clock.tickSec(6);
     assertEquals(
-       1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+       1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        0, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        0, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        0, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        0, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
 
     // After 10 seconds, queueB2 wants to preempt min share
     scheduler.update();
     clock.tickSec(5);
     assertEquals(
-        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        0, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        0, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
 
     // After 15 seconds, queueC wants to preempt min share
     scheduler.update();
     clock.tickSec(5);
     assertEquals(
-        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
 
     // After 20 seconds, queueB2 should want to preempt fair share
     scheduler.update();
     clock.tickSec(5);
     assertEquals(
-        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
 
     // After 25 seconds, queueB1 should want to preempt fair share
     scheduler.update();
     clock.tickSec(5);
     assertEquals(
-        1536, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        1024, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
 
     // After 30 seconds, queueC should want to preempt fair share
     scheduler.update();
     clock.tickSec(5);
     assertEquals(
-        1536, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueB1, clock.getTime()).getMemorySize());
     assertEquals(
-        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueB2, clock.getTime()).getMemorySize());
     assertEquals(
-        1536, scheduler.resourceDeficit(queueC, clock.getTime()).getMemory());
+        1536, scheduler.resourceDeficit(queueC, clock.getTime()).getMemorySize());
   }
 
   @Test
@@ -2622,9 +2622,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     
     // One container should get reservation and the other should get nothing
     assertEquals(1024,
-        scheduler.getSchedulerApp(attId1).getCurrentReservation().getMemory());
+        scheduler.getSchedulerApp(attId1).getCurrentReservation().getMemorySize());
     assertEquals(0,
-        scheduler.getSchedulerApp(attId2).getCurrentReservation().getMemory());
+        scheduler.getSchedulerApp(attId2).getCurrentReservation().getMemorySize());
   }
 
   @Test (timeout = 5000)
@@ -3943,7 +3943,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
 
     FSLeafQueue queue1 = scheduler.getQueueManager().getLeafQueue("queue1", true);
     assertEquals("Queue queue1's fair share should be 0", 0, queue1
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
 
     createSchedulingRequest(1 * 1024, "root.default", "user1");
     scheduler.update();
@@ -3961,11 +3961,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application1's AM requests 1024 MB memory",
-        1024, app1.getAMResource().getMemory());
+        1024, app1.getAMResource().getMemorySize());
     assertEquals("Application1's AM should be running",
         1, app1.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 1024 MB memory",
-        1024, queue1.getAmResourceUsage().getMemory());
+        1024, queue1.getAmResourceUsage().getMemorySize());
 
     // Exceeds no limits
     ApplicationAttemptId attId2 = createAppAttemptId(2, 1);
@@ -3975,11 +3975,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application2's AM requests 1024 MB memory",
-        1024, app2.getAMResource().getMemory());
+        1024, app2.getAMResource().getMemorySize());
     assertEquals("Application2's AM should be running",
         1, app2.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Exceeds queue limit
     ApplicationAttemptId attId3 = createAppAttemptId(3, 1);
@@ -3989,11 +3989,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application3's AM resource shouldn't be updated",
-        0, app3.getAMResource().getMemory());
+        0, app3.getAMResource().getMemorySize());
     assertEquals("Application3's AM should not be running",
         0, app3.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Still can run non-AM container
     createSchedulingRequestExistingApplication(1024, 1, attId1);
@@ -4002,7 +4002,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application1 should have two running containers",
         2, app1.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Remove app1, app3's AM should become running
     AppAttemptRemovedSchedulerEvent appRemovedEvent1 =
@@ -4015,9 +4015,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application3's AM should be running",
         1, app3.getLiveContainers().size());
     assertEquals("Application3's AM requests 1024 MB memory",
-        1024, app3.getAMResource().getMemory());
+        1024, app3.getAMResource().getMemorySize());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Exceeds queue limit
     ApplicationAttemptId attId4 = createAppAttemptId(4, 1);
@@ -4027,11 +4027,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application4's AM resource shouldn't be updated",
-        0, app4.getAMResource().getMemory());
+        0, app4.getAMResource().getMemorySize());
     assertEquals("Application4's AM should not be running",
         0, app4.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Exceeds queue limit
     ApplicationAttemptId attId5 = createAppAttemptId(5, 1);
@@ -4041,11 +4041,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application5's AM resource shouldn't be updated",
-        0, app5.getAMResource().getMemory());
+        0, app5.getAMResource().getMemorySize());
     assertEquals("Application5's AM should not be running",
         0, app5.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Remove un-running app doesn't affect others
     AppAttemptRemovedSchedulerEvent appRemovedEvent4 =
@@ -4056,7 +4056,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application5's AM should not be running",
         0, app5.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Remove app2 and app3, app5's AM should become running
     AppAttemptRemovedSchedulerEvent appRemovedEvent2 =
@@ -4074,9 +4074,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application5's AM should be running",
         1, app5.getLiveContainers().size());
     assertEquals("Application5's AM requests 2048 MB memory",
-        2048, app5.getAMResource().getMemory());
+        2048, app5.getAMResource().getMemorySize());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // request non-AM container for app5
     createSchedulingRequestExistingApplication(1024, 1, attId5);
@@ -4091,7 +4091,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application5's AM should have 0 container",
         0, app5.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
     scheduler.update();
     scheduler.handle(updateEvent);
     // non-AM container should be allocated
@@ -4101,7 +4101,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
         1, app5.getLiveContainers().size());
     // check non-AM container allocation won't affect queue AmResourceUsage
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Check amResource normalization
     ApplicationAttemptId attId6 = createAppAttemptId(6, 1);
@@ -4113,9 +4113,9 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     assertEquals("Application6's AM should not be running",
         0, app6.getLiveContainers().size());
     assertEquals("Application6's AM resource shouldn't be updated",
-        0, app6.getAMResource().getMemory());
+        0, app6.getAMResource().getMemorySize());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     // Remove all apps
     AppAttemptRemovedSchedulerEvent appRemovedEvent5 =
@@ -4126,7 +4126,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.handle(appRemovedEvent6);
     scheduler.update();
     assertEquals("Queue1's AM resource usage should be 0",
-        0, queue1.getAmResourceUsage().getMemory());
+        0, queue1.getAmResourceUsage().getMemorySize());
   }
 
   @Test
@@ -4165,23 +4165,23 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     FSLeafQueue queue1 =
         scheduler.getQueueManager().getLeafQueue("queue1", true);
     assertEquals("Queue queue1's fair share should be 0", 0, queue1
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
     FSLeafQueue queue2 =
         scheduler.getQueueManager().getLeafQueue("queue2", true);
     assertEquals("Queue queue2's fair share should be 0", 0, queue2
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
     FSLeafQueue queue3 =
         scheduler.getQueueManager().getLeafQueue("queue3", true);
     assertEquals("Queue queue3's fair share should be 0", 0, queue3
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
     FSLeafQueue queue4 =
         scheduler.getQueueManager().getLeafQueue("queue4", true);
     assertEquals("Queue queue4's fair share should be 0", 0, queue4
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
     FSLeafQueue queue5 =
         scheduler.getQueueManager().getLeafQueue("queue5", true);
     assertEquals("Queue queue5's fair share should be 0", 0, queue5
-        .getFairShare().getMemory());
+        .getFairShare().getMemorySize());
 
     List<String> queues = Arrays.asList("root.queue3", "root.queue4",
         "root.queue5");
@@ -4203,11 +4203,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application1's AM requests 1024 MB memory",
-        1024, app1.getAMResource().getMemory());
+        1024, app1.getAMResource().getMemorySize());
     assertEquals("Application1's AM should be running",
         1, app1.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 1024 MB memory",
-        1024, queue1.getAmResourceUsage().getMemory());
+        1024, queue1.getAmResourceUsage().getMemorySize());
 
     // Now the fair share is 1639 MB, and the maxAMShare is 0.4f,
     // so the AM is not accepted.
@@ -4218,11 +4218,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.update();
     scheduler.handle(updateEvent);
     assertEquals("Application2's AM resource shouldn't be updated",
-        0, app2.getAMResource().getMemory());
+        0, app2.getAMResource().getMemorySize());
     assertEquals("Application2's AM should not be running",
         0, app2.getLiveContainers().size());
     assertEquals("Queue2's AM resource usage should be 0 MB memory",
-        0, queue2.getAmResourceUsage().getMemory());
+        0, queue2.getAmResourceUsage().getMemorySize());
   }
 
   /**
@@ -4304,11 +4304,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Allocate app1's AM container on node1.
     scheduler.handle(updateE1);
     assertEquals("Application1's AM requests 1024 MB memory",
-        1024, app1.getAMResource().getMemory());
+        1024, app1.getAMResource().getMemorySize());
     assertEquals("Application1's AM should be running",
         1, app1.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 1024 MB memory",
-        1024, queue1.getAmResourceUsage().getMemory());
+        1024, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId2 = createAppAttemptId(2, 1);
     createApplicationWithAMResource(attId2, "queue1", "user1", amResource2);
@@ -4318,11 +4318,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Allocate app2's AM container on node2.
     scheduler.handle(updateE2);
     assertEquals("Application2's AM requests 1024 MB memory",
-        1024, app2.getAMResource().getMemory());
+        1024, app2.getAMResource().getMemorySize());
     assertEquals("Application2's AM should be running",
         1, app2.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId3 = createAppAttemptId(3, 1);
     createApplicationWithAMResource(attId3, "queue1", "user1", amResource3);
@@ -4335,11 +4335,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Similarly app3 reserves a container on node2.
     scheduler.handle(updateE2);
     assertEquals("Application3's AM resource shouldn't be updated",
-        0, app3.getAMResource().getMemory());
+        0, app3.getAMResource().getMemorySize());
     assertEquals("Application3's AM should not be running",
         0, app3.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId4 = createAppAttemptId(4, 1);
     createApplicationWithAMResource(attId4, "queue1", "user1", amResource4);
@@ -4350,21 +4350,21 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // app3 already reserved its container on node1.
     scheduler.handle(updateE1);
     assertEquals("Application4's AM resource shouldn't be updated",
-        0, app4.getAMResource().getMemory());
+        0, app4.getAMResource().getMemorySize());
     assertEquals("Application4's AM should not be running",
         0, app4.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     scheduler.update();
     // Allocate app4's AM container on node3.
     scheduler.handle(updateE3);
     assertEquals("Application4's AM requests 5120 MB memory",
-        5120, app4.getAMResource().getMemory());
+        5120, app4.getAMResource().getMemorySize());
     assertEquals("Application4's AM should be running",
         1, app4.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 7168 MB memory",
-        7168, queue1.getAmResourceUsage().getMemory());
+        7168, queue1.getAmResourceUsage().getMemorySize());
 
     AppAttemptRemovedSchedulerEvent appRemovedEvent1 =
         new AppAttemptRemovedSchedulerEvent(attId1,
@@ -4372,7 +4372,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Release app1's AM container on node1.
     scheduler.handle(appRemovedEvent1);
     assertEquals("Queue1's AM resource usage should be 6144 MB memory",
-        6144, queue1.getAmResourceUsage().getMemory());
+        6144, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId5 = createAppAttemptId(5, 1);
     createApplicationWithAMResource(attId5, "queue1", "user1", amResource5);
@@ -4384,11 +4384,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // exceeding queue MaxAMShare limit.
     scheduler.handle(updateE1);
     assertEquals("Application5's AM requests 1024 MB memory",
-        1024, app5.getAMResource().getMemory());
+        1024, app5.getAMResource().getMemorySize());
     assertEquals("Application5's AM should be running",
         1, app5.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 7168 MB memory",
-        7168, queue1.getAmResourceUsage().getMemory());
+        7168, queue1.getAmResourceUsage().getMemorySize());
 
     AppAttemptRemovedSchedulerEvent appRemovedEvent3 =
         new AppAttemptRemovedSchedulerEvent(attId3,
@@ -4396,7 +4396,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Remove app3.
     scheduler.handle(appRemovedEvent3);
     assertEquals("Queue1's AM resource usage should be 7168 MB memory",
-        7168, queue1.getAmResourceUsage().getMemory());
+        7168, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId6 = createAppAttemptId(6, 1);
     createApplicationWithAMResource(attId6, "queue1", "user1", amResource6);
@@ -4407,11 +4407,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // it exceeds queue MaxAMShare limit.
     scheduler.handle(updateE1);
     assertEquals("Application6's AM resource shouldn't be updated",
-        0, app6.getAMResource().getMemory());
+        0, app6.getAMResource().getMemorySize());
     assertEquals("Application6's AM should not be running",
         0, app6.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 7168 MB memory",
-        7168, queue1.getAmResourceUsage().getMemory());
+        7168, queue1.getAmResourceUsage().getMemorySize());
 
     ApplicationAttemptId attId7 = createAppAttemptId(7, 1);
     createApplicationWithAMResource(attId7, "queue1", "user1", amResource7);
@@ -4422,11 +4422,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // app6 didn't reserve a container on node1.
     scheduler.handle(updateE1);
     assertEquals("Application7's AM requests 1024 MB memory",
-        1024, app7.getAMResource().getMemory());
+        1024, app7.getAMResource().getMemorySize());
     assertEquals("Application7's AM should be running",
         1, app7.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 8192 MB memory",
-        8192, queue1.getAmResourceUsage().getMemory());
+        8192, queue1.getAmResourceUsage().getMemorySize());
 
     AppAttemptRemovedSchedulerEvent appRemovedEvent4 =
         new AppAttemptRemovedSchedulerEvent(attId4,
@@ -4434,7 +4434,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Release app4's AM container on node3.
     scheduler.handle(appRemovedEvent4);
     assertEquals("Queue1's AM resource usage should be 3072 MB memory",
-        3072, queue1.getAmResourceUsage().getMemory());
+        3072, queue1.getAmResourceUsage().getMemorySize());
 
     AppAttemptRemovedSchedulerEvent appRemovedEvent5 =
         new AppAttemptRemovedSchedulerEvent(attId5,
@@ -4442,7 +4442,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Release app5's AM container on node1.
     scheduler.handle(appRemovedEvent5);
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-              2048, queue1.getAmResourceUsage().getMemory());
+              2048, queue1.getAmResourceUsage().getMemorySize());
 
     scheduler.update();
     // app6 reserves a container on node1 because node1's available resource
@@ -4461,21 +4461,21 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // app6 already reserved a container on node1.
     scheduler.handle(updateE1);
     assertEquals("Application8's AM resource shouldn't be updated",
-        0, app8.getAMResource().getMemory());
+        0, app8.getAMResource().getMemorySize());
     assertEquals("Application8's AM should not be running",
         0, app8.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
     scheduler.update();
     // app8 can't allocate a container on node2 because
     // app6 already reserved a container on node2.
     scheduler.handle(updateE2);
     assertEquals("Application8's AM resource shouldn't be updated",
-        0, app8.getAMResource().getMemory());
+        0, app8.getAMResource().getMemorySize());
     assertEquals("Application8's AM should not be running",
         0, app8.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 2048 MB memory",
-        2048, queue1.getAmResourceUsage().getMemory());
+        2048, queue1.getAmResourceUsage().getMemorySize());
 
     AppAttemptRemovedSchedulerEvent appRemovedEvent2 =
         new AppAttemptRemovedSchedulerEvent(attId2,
@@ -4483,17 +4483,17 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Release app2's AM container on node2.
     scheduler.handle(appRemovedEvent2);
     assertEquals("Queue1's AM resource usage should be 1024 MB memory",
-        1024, queue1.getAmResourceUsage().getMemory());
+        1024, queue1.getAmResourceUsage().getMemorySize());
 
     scheduler.update();
     // app6 turns the reservation into an allocation on node2.
     scheduler.handle(updateE2);
     assertEquals("Application6's AM requests 10240 MB memory",
-        10240, app6.getAMResource().getMemory());
+        10240, app6.getAMResource().getMemorySize());
     assertEquals("Application6's AM should be running",
         1, app6.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 11264 MB memory",
-        11264, queue1.getAmResourceUsage().getMemory());
+        11264, queue1.getAmResourceUsage().getMemorySize());
 
     scheduler.update();
     // app6 unreserve its container on node1 because
@@ -4501,11 +4501,11 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     // Now app8 can allocate its AM container on node1.
     scheduler.handle(updateE1);
     assertEquals("Application8's AM requests 1024 MB memory",
-        1024, app8.getAMResource().getMemory());
+        1024, app8.getAMResource().getMemorySize());
     assertEquals("Application8's AM should be running",
         1, app8.getLiveContainers().size());
     assertEquals("Queue1's AM resource usage should be 12288 MB memory",
-        12288, queue1.getAmResourceUsage().getMemory());
+        12288, queue1.getAmResourceUsage().getMemorySize());
   }
 
   @Test
@@ -4611,7 +4611,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.handle(nodeEvent2);
 
     // available resource
-    Assert.assertEquals(scheduler.getClusterResource().getMemory(), 16 * 1024);
+    Assert.assertEquals(scheduler.getClusterResource().getMemorySize(), 16 * 1024);
     Assert.assertEquals(scheduler.getClusterResource().getVirtualCores(), 16);
 
     // send application request
@@ -4636,7 +4636,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     while (app.getCurrentConsumption().equals(Resources.none())) { }
 
     // check consumption
-    Assert.assertEquals(1024, app.getCurrentConsumption().getMemory());
+    Assert.assertEquals(1024, app.getCurrentConsumption().getMemorySize());
     Assert.assertEquals(1, app.getCurrentConsumption().getVirtualCores());
 
     // another request
@@ -4647,7 +4647,7 @@ public class TestFairScheduler extends FairSchedulerTestBase {
     scheduler.stop();
     scheduler.allocate(appAttemptId, ask, new ArrayList<ContainerId>(), null, null, null, null);
     scheduler.continuousSchedulingAttempt();
-    Assert.assertEquals(2048, app.getCurrentConsumption().getMemory());
+    Assert.assertEquals(2048, app.getCurrentConsumption().getMemorySize());
     Assert.assertEquals(2, app.getCurrentConsumption().getVirtualCores());
 
     // 2 containers should be assigned to 2 nodes
@@ -5358,23 +5358,24 @@ public class TestFairScheduler extends FairSchedulerTestBase {
         new NodeUpdateSchedulerEvent(spyNode));
 
     // Check the used resource is 0 GB 0 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(), 0);
+    Assert.assertEquals(usedResource.getMemorySize(), 0);
+
     Assert.assertEquals(usedResource.getVirtualCores(), 0);
     // Check total resource of scheduler node is also changed to 0 GB 0 core
     Resource totalResource =
         resourceManager.getResourceScheduler()
             .getSchedulerNode(nm_0.getNodeId()).getTotalResource();
-    Assert.assertEquals(totalResource.getMemory(), 0 * GB);
+    Assert.assertEquals(totalResource.getMemorySize(), 0 * GB);
     Assert.assertEquals(totalResource.getVirtualCores(), 0);
     // 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/fair/TestFairSchedulerFairShare.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerFairShare.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerFairShare.java
index ab8fcbc..a79aacc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerFairShare.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerFairShare.java
@@ -109,10 +109,10 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
 
     for (FSLeafQueue leaf : leafQueues) {
       if (leaf.getName().startsWith("root.parentA")) {
-        assertEquals(0, (double) leaf.getFairShare().getMemory() / nodeCapacity,
+        assertEquals(0, (double) leaf.getFairShare().getMemorySize() / nodeCapacity,
             0);
       } else if (leaf.getName().startsWith("root.parentB")) {
-        assertEquals(0, (double) leaf.getFairShare().getMemory() / nodeCapacity,
+        assertEquals(0, (double) leaf.getFairShare().getMemorySize() / nodeCapacity,
             0);
       }
     }
@@ -137,12 +137,12 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
         100,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentA.childA1", false).getFairShare()
-            .getMemory() / nodeCapacity * 100, 0.1);
+            .getMemorySize() / nodeCapacity * 100, 0.1);
     assertEquals(
         0,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentA.childA2", false).getFairShare()
-            .getMemory() / nodeCapacity, 0.1);
+            .getMemorySize() / nodeCapacity, 0.1);
 
     verifySteadyFairShareMemory(scheduler.getQueueManager().getLeafQueues(),
         nodeCapacity);
@@ -167,7 +167,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
           33,
           (double) scheduler.getQueueManager()
               .getLeafQueue("root.parentA.childA" + i, false).getFairShare()
-              .getMemory()
+              .getMemorySize()
               / nodeCapacity * 100, .9);
     }
 
@@ -200,7 +200,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
           40,
           (double) scheduler.getQueueManager()
               .getLeafQueue("root.parentA.childA" + i, false).getFairShare()
-              .getMemory()
+              .getMemorySize()
               / nodeCapacity * 100, .9);
     }
 
@@ -210,7 +210,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
         10,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentB.childB1", false).getFairShare()
-            .getMemory()
+            .getMemorySize()
             / nodeCapacity * 100, .9);
 
     verifySteadyFairShareMemory(scheduler.getQueueManager().getLeafQueues(),
@@ -237,7 +237,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
           50,
           (double) scheduler.getQueueManager()
               .getLeafQueue("root.parentA.childA" + i, false).getFairShare()
-              .getMemory()
+              .getMemorySize()
               / nodeCapacity * 100, .9);
     }
     // Let app under childA1 complete. This should cause the fair share
@@ -254,13 +254,13 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
         0,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentA.childA1", false).getFairShare()
-            .getMemory()
+            .getMemorySize()
             / nodeCapacity * 100, 0);
     assertEquals(
         100,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentA.childA2", false).getFairShare()
-            .getMemory()
+            .getMemorySize()
             / nodeCapacity * 100, 0.1);
 
     verifySteadyFairShareMemory(scheduler.getQueueManager().getLeafQueues(),
@@ -293,7 +293,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
           40,
           (double) scheduler.getQueueManager()
               .getLeafQueue("root.parentA.childA" + i, false).getFairShare()
-              .getMemory()
+              .getMemorySize()
               / nodeMem * 100, .9);
       assertEquals(
           40,
@@ -308,7 +308,7 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
         10,
         (double) scheduler.getQueueManager()
             .getLeafQueue("root.parentB.childB1", false).getFairShare()
-            .getMemory()
+            .getMemorySize()
             / nodeMem * 100, .9);
     assertEquals(
         10,
@@ -322,13 +322,13 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
     for (FSLeafQueue leaf : leafQueues) {
       if (leaf.getName().startsWith("root.parentA")) {
         assertEquals(0.2,
-            (double) leaf.getSteadyFairShare().getMemory() / nodeMem, 0.001);
+            (double) leaf.getSteadyFairShare().getMemorySize() / nodeMem, 0.001);
         assertEquals(0.2,
             (double) leaf.getSteadyFairShare().getVirtualCores() / nodeVCores,
             0.001);
       } else if (leaf.getName().startsWith("root.parentB")) {
         assertEquals(0.05,
-            (double) leaf.getSteadyFairShare().getMemory() / nodeMem, 0.001);
+            (double) leaf.getSteadyFairShare().getMemorySize() / nodeMem, 0.001);
         assertEquals(0.1,
             (double) leaf.getSteadyFairShare().getVirtualCores() / nodeVCores,
             0.001);
@@ -348,11 +348,11 @@ public class TestFairSchedulerFairShare extends FairSchedulerTestBase {
     for (FSLeafQueue leaf : leafQueues) {
       if (leaf.getName().startsWith("root.parentA")) {
         assertEquals(0.2,
-            (double) leaf.getSteadyFairShare().getMemory() / nodeCapacity,
+            (double) leaf.getSteadyFairShare().getMemorySize() / nodeCapacity,
             0.001);
       } else if (leaf.getName().startsWith("root.parentB")) {
         assertEquals(0.05,
-            (double) leaf.getSteadyFairShare().getMemory() / nodeCapacity,
+            (double) leaf.getSteadyFairShare().getMemorySize() / nodeCapacity,
             0.001);
       }
     }

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/fair/TestFairSchedulerPreemption.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerPreemption.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerPreemption.java
index 6f759ce..1d5a70f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerPreemption.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFairSchedulerPreemption.java
@@ -48,11 +48,11 @@ public class TestFairSchedulerPreemption extends FairSchedulerTestBase {
   private ControlledClock clock;
 
   private static class StubbedFairScheduler extends FairScheduler {
-    public int lastPreemptMemory = -1;
+    public long lastPreemptMemory = -1;
 
     @Override
     protected void preemptResources(Resource toPreempt) {
-      lastPreemptMemory = toPreempt.getMemory();
+      lastPreemptMemory = toPreempt.getMemorySize();
     }
 
     public void resetLastPreemptResources() {

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/fifo/TestFifoScheduler.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/fifo/TestFifoScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
index 7b06319..3167726 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/TestFifoScheduler.java
@@ -346,9 +346,9 @@ public class TestFifoScheduler {
     
     // SchedulerNode's total resource and available resource are changed.
     assertEquals(schedulerNodes.get(node0.getNodeID()).getTotalResource()
-        .getMemory(), 1024);
+        .getMemorySize(), 1024);
     assertEquals(schedulerNodes.get(node0.getNodeID()).
-        getAvailableResource().getMemory(), 1024);
+        getAvailableResource().getMemorySize(), 1024);
     QueueInfo queueInfo = scheduler.getQueueInfo(null, false, false);
     Assert.assertEquals(0.0f, queueInfo.getCurrentCapacity(), 0.0f);
     
@@ -704,7 +704,7 @@ public class TestFifoScheduler {
     am1.registerAppAttempt();
     SchedulerNodeReport report_nm1 =
         rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemory());
+    Assert.assertEquals(2 * GB, report_nm1.getUsedResource().getMemorySize());
 
     RMApp app2 = rm.submitApp(2048);
     // kick the scheduling, 2GB given to AM, remaining 2 GB on nm2
@@ -714,7 +714,7 @@ public class TestFifoScheduler {
     am2.registerAppAttempt();
     SchedulerNodeReport report_nm2 =
         rm.getResourceScheduler().getNodeReport(nm2.getNodeId());
-    Assert.assertEquals(2 * GB, report_nm2.getUsedResource().getMemory());
+    Assert.assertEquals(2 * GB, report_nm2.getUsedResource().getMemorySize());
 
     // add request for containers
     am1.addRequests(new String[] { "127.0.0.1", "127.0.0.2" }, GB, 1, 1);
@@ -740,24 +740,24 @@ public class TestFifoScheduler {
 
     List<Container> allocated1 = alloc1Response.getAllocatedContainers();
     Assert.assertEquals(1, allocated1.size());
-    Assert.assertEquals(1 * GB, allocated1.get(0).getResource().getMemory());
+    Assert.assertEquals(1 * GB, allocated1.get(0).getResource().getMemorySize());
     Assert.assertEquals(nm1.getNodeId(), allocated1.get(0).getNodeId());
 
     List<Container> allocated2 = alloc2Response.getAllocatedContainers();
     Assert.assertEquals(1, allocated2.size());
-    Assert.assertEquals(3 * GB, allocated2.get(0).getResource().getMemory());
+    Assert.assertEquals(3 * GB, allocated2.get(0).getResource().getMemorySize());
     Assert.assertEquals(nm1.getNodeId(), allocated2.get(0).getNodeId());
 
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
     report_nm2 = rm.getResourceScheduler().getNodeReport(nm2.getNodeId());
-    Assert.assertEquals(0, report_nm1.getAvailableResource().getMemory());
-    Assert.assertEquals(2 * GB, report_nm2.getAvailableResource().getMemory());
+    Assert.assertEquals(0, report_nm1.getAvailableResource().getMemorySize());
+    Assert.assertEquals(2 * GB, report_nm2.getAvailableResource().getMemorySize());
 
-    Assert.assertEquals(6 * GB, report_nm1.getUsedResource().getMemory());
-    Assert.assertEquals(2 * GB, report_nm2.getUsedResource().getMemory());
+    Assert.assertEquals(6 * GB, report_nm1.getUsedResource().getMemorySize());
+    Assert.assertEquals(2 * GB, report_nm2.getUsedResource().getMemorySize());
 
     Container c1 = allocated1.get(0);
-    Assert.assertEquals(GB, c1.getResource().getMemory());
+    Assert.assertEquals(GB, c1.getResource().getMemorySize());
     ContainerStatus containerStatus =
         BuilderUtils.newContainerStatus(c1.getId(), ContainerState.COMPLETE,
             "", 0, c1.getResource());
@@ -772,7 +772,7 @@ public class TestFifoScheduler {
     Assert.assertEquals(1, am1.schedule().getCompletedContainersStatuses()
         .size());
     report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
-    Assert.assertEquals(5 * GB, report_nm1.getUsedResource().getMemory());
+    Assert.assertEquals(5 * GB, report_nm1.getUsedResource().getMemorySize());
 
     rm.stop();
   }
@@ -829,7 +829,7 @@ public class TestFifoScheduler {
     int checkAlloc =
         conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
             YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB);
-    Assert.assertEquals(checkAlloc, report_nm1.getUsedResource().getMemory());
+    Assert.assertEquals(checkAlloc, report_nm1.getUsedResource().getMemorySize());
 
     rm.stop();
   }
@@ -1083,12 +1083,12 @@ public class TestFifoScheduler {
     Allocation allocation1 =
         fs.allocate(appAttemptId1, emptyAsk, emptyId, null, null, null, null);
     Assert.assertEquals("Allocation headroom", 1 * GB, allocation1
-        .getResourceLimit().getMemory());
+        .getResourceLimit().getMemorySize());
 
     Allocation allocation2 =
         fs.allocate(appAttemptId2, emptyAsk, emptyId, null, null, null, null);
     Assert.assertEquals("Allocation headroom", 1 * GB, allocation2
-        .getResourceLimit().getMemory());
+        .getResourceLimit().getMemorySize());
 
     rm.stop();
   }
@@ -1110,8 +1110,8 @@ public class TestFifoScheduler {
     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);
@@ -1127,17 +1127,17 @@ public class TestFifoScheduler {
 
     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 =
@@ -1152,7 +1152,7 @@ public class TestFifoScheduler {
     while (waitCount++ != 20) {
       report_nm1 = rm.getResourceScheduler().getNodeReport(nm1.getNodeId());
       if (null != report_nm1 &&
-          report_nm1.getAvailableResource().getMemory() != 0) {
+          report_nm1.getAvailableResource().getMemorySize() != 0) {
         break;
       }
       LOG.info("Waiting for RMNodeResourceUpdateEvent to be handled... Tried "
@@ -1161,8 +1161,9 @@ public class TestFifoScheduler {
     }
     // 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.
@@ -1180,9 +1181,9 @@ public class TestFifoScheduler {
     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());
     rm.stop();
   }
 
@@ -1259,30 +1260,30 @@ public class TestFifoScheduler {
     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);
   }
 
   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();
   }
 

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/webapp/TestRMWebServicesApps.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/webapp/TestRMWebServicesApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
index 5ce756b..3e7abce 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
@@ -1410,7 +1410,7 @@ public class TestRMWebServicesApps extends JerseyTestBase {
     assertEquals("clusterUsagePerc doesn't match", 50.0f, clusterUsagePerc, 0.01f);
     assertEquals("numContainers doesn't match", 1, numContainers);
     assertEquals("preemptedResourceMB doesn't match", app
-        .getRMAppMetrics().getResourcePreempted().getMemory(),
+        .getRMAppMetrics().getResourcePreempted().getMemorySize(),
         preemptedResourceMB);
     assertEquals("preemptedResourceVCores doesn't match", app
         .getRMAppMetrics().getResourcePreempted().getVirtualCores(),

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/webapp/TestRMWebServicesNodes.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/webapp/TestRMWebServicesNodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
index 67488b1..061ba6e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
@@ -777,9 +777,9 @@ public class TestRMWebServicesNodes extends JerseyTestBase {
       assertEquals("numContainers doesn't match: " + numContainers,
           report.getNumContainers(), numContainers);
       assertEquals("usedMemoryMB doesn't match: " + usedMemoryMB, report
-          .getUsedResource().getMemory(), usedMemoryMB);
+          .getUsedResource().getMemorySize(), usedMemoryMB);
       assertEquals("availMemoryMB doesn't match: " + availMemoryMB, report
-          .getAvailableResource().getMemory(), availMemoryMB);
+          .getAvailableResource().getMemorySize(), availMemoryMB);
       assertEquals("usedVirtualCores doesn't match: " + usedVirtualCores, report
           .getUsedResource().getVirtualCores(), usedVirtualCores);
       assertEquals("availVirtualCores doesn't match: " + availVirtualCores, report


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