aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Added non-prod consumption info to getQuota call.
Date Sat, 01 Mar 2014 02:38:51 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master e9c09b121 -> 04e04522f


Added non-prod consumption info to getQuota call.

This call will be used by the role page in the UI.

Testing Done:
./gradlew clean build.

Bugs closed: AURORA-65

Reviewed at https://reviews.apache.org/r/17347/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/04e04522
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/04e04522
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/04e04522

Branch: refs/heads/master
Commit: 04e04522f3c1c3b73a23c20f715e3b368c098578
Parents: e9c09b1
Author: Suman Karumuri <mansu@apache.org>
Authored: Fri Feb 28 18:37:17 2014 -0800
Committer: Suman Karumuri <skarumuri@twitter.com>
Committed: Fri Feb 28 18:37:17 2014 -0800

----------------------------------------------------------------------
 .../aurora/scheduler/thrift/SchedulerThriftInterface.java   | 3 ++-
 src/main/thrift/org/apache/aurora/gen/api.thrift            | 5 +++--
 .../scheduler/thrift/SchedulerThriftInterfaceTest.java      | 9 ++++++++-
 src/test/resources/org/apache/aurora/gen/api.thrift.md5     | 2 +-
 4 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/04e04522/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
index 7b9f185..4911c77 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -601,7 +601,8 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
 
     QuotaInfo quotaInfo = quotaManager.getQuotaInfo(ownerRole);
     GetQuotaResult result = new GetQuotaResult(quotaInfo.guota().newBuilder())
-        .setConsumed(quotaInfo.prodConsumption().newBuilder());
+        .setProdConsumption(quotaInfo.prodConsumption().newBuilder())
+        .setNonProdConsumption(quotaInfo.nonProdConsumption().newBuilder());
 
     return new Response().setResponseCode(OK).setResult(Result.getQuotaResult(result));
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/04e04522/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/src/main/thrift/org/apache/aurora/gen/api.thrift b/src/main/thrift/org/apache/aurora/gen/api.thrift
index f9fc6bc..2afbb4c 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -214,8 +214,9 @@ struct PopulateJobResult {
 }
 
 struct GetQuotaResult {
-  1: ResourceAggregate quota              // Total allocated quota.
-  2: optional ResourceAggregate consumed  // Amount of quota already consumed by a role.
+  1: ResourceAggregate quota                       // Total allocated resource quota.
+  2: optional ResourceAggregate prodConsumption    // Resources consumed by production jobs.
+  3: optional ResourceAggregate nonProdConsumption // Resources consumed by non-production
jobs.
 }
 
 // Wraps return results for the acquireLock API.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/04e04522/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
index dc55771..cd532bd 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
@@ -1342,12 +1342,19 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
     expect(quotaManager.getQuotaInfo(ROLE)).andReturn(infoMock);
     expect(infoMock.guota()).andReturn(QUOTA);
     expect(infoMock.prodConsumption()).andReturn(CONSUMED);
+    IResourceAggregate nonProdConsumed = IResourceAggregate.build(new ResourceAggregate(1,
0, 0));
+    expect(infoMock.nonProdConsumption()).andReturn(nonProdConsumed);
     control.replay();
 
     Response response = thrift.getQuota(ROLE);
     assertEquals(ResponseCode.OK, response.getResponseCode());
     assertEquals(QUOTA.newBuilder(), response.getResult().getGetQuotaResult().getQuota());
-    assertEquals(CONSUMED.newBuilder(), response.getResult().getGetQuotaResult().getConsumed());
+    assertEquals(
+        CONSUMED.newBuilder(),
+        response.getResult().getGetQuotaResult().getProdConsumption());
+    assertEquals(
+        nonProdConsumed.newBuilder(),
+        response.getResult().getGetQuotaResult().getNonProdConsumption());
   }
 
   private static JobConfiguration makeJob() {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/04e04522/src/test/resources/org/apache/aurora/gen/api.thrift.md5
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/aurora/gen/api.thrift.md5 b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
index 08c4c2a..5cfa330 100644
--- a/src/test/resources/org/apache/aurora/gen/api.thrift.md5
+++ b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
@@ -1 +1 @@
-7bf1d42fb84abddbfd8f580dd7dfdb03
+48965974ea35ab83fc54651c4f13f604


Mime
View raw message