aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Renamed getJobSummary call to getRoleSummary
Date Sat, 22 Feb 2014 03:08:45 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 95459d809 -> f679dfb54


Renamed getJobSummary call to getRoleSummary

getJobSummary will be reused to return the jobs.

Testing Done:
gradle clean build
gradle run and tested on my laptop

Bugs closed: AURORA-64

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


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

Branch: refs/heads/master
Commit: f679dfb5470bb6df558b8526a29767a05954d22f
Parents: 95459d8
Author: Suman Karumuri <mansu@apache.org>
Authored: Fri Feb 21 18:57:46 2014 -0800
Committer: Suman Karumuri <skarumuri@twitter.com>
Committed: Fri Feb 21 18:57:46 2014 -0800

----------------------------------------------------------------------
 .../scheduler/thrift/SchedulerThriftInterface.java    | 14 +++++++-------
 .../apache/aurora/scheduler/http/ui/js/services.js    |  4 ++--
 src/main/thrift/org/apache/aurora/gen/api.thrift      | 10 +++++-----
 .../thrift/SchedulerThriftInterfaceTest.java          | 14 +++++++-------
 .../aurora/scheduler/thrift/aop/ForwardingThrift.java |  4 ++--
 .../resources/org/apache/aurora/gen/api.thrift.md5    |  2 +-
 6 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/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 7f7e34d..e6a32b8 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -69,8 +69,6 @@ import org.apache.aurora.gen.InstanceKey;
 import org.apache.aurora.gen.JobConfigRewrite;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobKey;
-import org.apache.aurora.gen.JobSummary;
-import org.apache.aurora.gen.JobSummaryResult;
 import org.apache.aurora.gen.ListBackupsResult;
 import org.apache.aurora.gen.Lock;
 import org.apache.aurora.gen.LockKey;
@@ -83,6 +81,8 @@ import org.apache.aurora.gen.Response;
 import org.apache.aurora.gen.ResponseCode;
 import org.apache.aurora.gen.Result;
 import org.apache.aurora.gen.RewriteConfigsRequest;
+import org.apache.aurora.gen.RoleSummary;
+import org.apache.aurora.gen.RoleSummaryResult;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduleStatusResult;
 import org.apache.aurora.gen.SessionKey;
@@ -374,7 +374,7 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
   }
 
   @Override
-  public Response getJobSummary() {
+  public Response getRoleSummary() {
     Multimap<String, IJobKey> jobsByRole = mapByRole(
         Storage.Util.weaklyConsistentFetchTasks(storage, Query.unscoped()),
         Tasks.SCHEDULED_TO_JOB_KEY);
@@ -383,18 +383,18 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
         cronJobManager.getJobs(),
         JobKeys.FROM_CONFIG);
 
-    Set<JobSummary> jobSummaries = Sets.newHashSet();
+    Set<RoleSummary> summaries = Sets.newHashSet();
     for (String role : Sets.union(jobsByRole.keySet(), cronJobsByRole.keySet())) {
-      JobSummary summary = new JobSummary();
+      RoleSummary summary = new RoleSummary();
       summary.setRole(role);
       summary.setJobCount(jobsByRole.get(role).size());
       summary.setCronJobCount(cronJobsByRole.get(role).size());
-      jobSummaries.add(summary);
+      summaries.add(summary);
     }
 
     return new Response()
         .setResponseCode(OK)
-        .setResult(Result.jobSummaryResult(new JobSummaryResult(jobSummaries)));
+        .setResult(Result.roleSummaryResult(new RoleSummaryResult(summaries)));
   }
 
   private static <T> Multimap<String, IJobKey> mapByRole(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
index a0385e9..9418964 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js
@@ -5,11 +5,11 @@ auroraUI.factory(
   function () {
     return {
       getJobSummary: function () {
-        var response = this.makeSchedulerClient().getJobSummary();
+        var response = this.makeSchedulerClient().getRoleSummary();
         return {
           error : response.responseCode !== 1,
           errorMsg : response.message,
-          summaries : response.result !== null ? response.result.jobSummaryResult.summaries
: []
+          summaries : response.result !== null ? response.result.roleSummaryResult.summaries
: []
         }
      },
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/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 43a2496..cd60f47 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -370,7 +370,7 @@ struct HostStatus {
   2: MaintenanceMode mode
 }
 
-struct JobSummary {
+struct RoleSummary {
   1: string role
   2: i32 jobCount
   3: i32 cronJobCount
@@ -404,8 +404,8 @@ struct EndMaintenanceResult {
   1: set<HostStatus> statuses
 }
 
-struct JobSummaryResult {
-  1: set<JobSummary> summaries
+struct RoleSummaryResult {
+  1: set<RoleSummary> summaries
 }
 
 union Result {
@@ -421,7 +421,7 @@ union Result {
   11: EndMaintenanceResult endMaintenanceResult
   15: APIVersion getVersionResult
   16: AcquireLockResult acquireLockResult
-  17: JobSummaryResult jobSummaryResult
+  17: RoleSummaryResult roleSummaryResult
 }
 
 struct Response {
@@ -434,7 +434,7 @@ struct Response {
 // A service that provides all the read only calls to the Aurora scheduler.
 service ReadOnlyScheduler {
   // Returns a summary of the jobs grouped by role.
-  Response getJobSummary()
+  Response getRoleSummary()
 
   // Fetches the status of tasks.
   Response getTasksStatus(1: TaskQuery query)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/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 656e44e..f0f0e39 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
@@ -48,8 +48,6 @@ import org.apache.aurora.gen.InstanceKey;
 import org.apache.aurora.gen.JobConfigRewrite;
 import org.apache.aurora.gen.JobConfiguration;
 import org.apache.aurora.gen.JobKey;
-import org.apache.aurora.gen.JobSummary;
-import org.apache.aurora.gen.JobSummaryResult;
 import org.apache.aurora.gen.LimitConstraint;
 import org.apache.aurora.gen.Lock;
 import org.apache.aurora.gen.LockKey;
@@ -57,6 +55,8 @@ import org.apache.aurora.gen.Quota;
 import org.apache.aurora.gen.Response;
 import org.apache.aurora.gen.ResponseCode;
 import org.apache.aurora.gen.RewriteConfigsRequest;
+import org.apache.aurora.gen.RoleSummary;
+import org.apache.aurora.gen.RoleSummaryResult;
 import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.ScheduledTask;
 import org.apache.aurora.gen.SessionKey;
@@ -1083,17 +1083,17 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
 
     expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));
 
-    JobSummaryResult expectedResult = new JobSummaryResult();
+    RoleSummaryResult expectedResult = new RoleSummaryResult();
     expectedResult.addToSummaries(
-        new JobSummary().setRole(ROLE).setCronJobCount(2).setJobCount(1));
+        new RoleSummary().setRole(ROLE).setCronJobCount(2).setJobCount(1));
     expectedResult.addToSummaries(
-        new JobSummary().setRole(BAZ_ROLE).setCronJobCount(1).setJobCount(2));
+        new RoleSummary().setRole(BAZ_ROLE).setCronJobCount(1).setJobCount(2));
 
     control.replay();
 
-    Response response = thrift.getJobSummary();
+    Response response = thrift.getRoleSummary();
     assertEquals(ResponseCode.OK, response.getResponseCode());
-    assertEquals(expectedResult, response.getResult().getJobSummaryResult());
+    assertEquals(expectedResult, response.getResult().getRoleSummaryResult());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/src/test/java/org/apache/aurora/scheduler/thrift/aop/ForwardingThrift.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ForwardingThrift.java b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ForwardingThrift.java
index b4f7775..1edc0d7 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ForwardingThrift.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ForwardingThrift.java
@@ -105,8 +105,8 @@ abstract class ForwardingThrift implements AuroraAdmin.Iface {
   }
 
   @Override
-  public Response getJobSummary() throws TException {
-    return delegate.getJobSummary();
+  public Response getRoleSummary() throws TException {
+    return delegate.getRoleSummary();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/f679dfb5/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 10f5cda..fafb510 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 @@
-152048bed66e3b7a92e5f0343c556bee
+cbc45c78b7a0a8f0c7cd0beb153d5b37


Mime
View raw message