aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject git commit: Instruct thrift to generate private fields in java.
Date Tue, 16 Sep 2014 00:55:42 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 78c8dcc39 -> 9e0b9ac43


Instruct thrift to generate private fields in java.

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


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

Branch: refs/heads/master
Commit: 9e0b9ac43c4377c283614070dad361fe5e5bd376
Parents: 78c8dcc
Author: Bill Farner <wfarner@apache.org>
Authored: Mon Sep 15 17:49:14 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Mon Sep 15 17:54:06 2014 -0700

----------------------------------------------------------------------
 build.gradle                                                 | 4 +++-
 src/main/java/org/apache/aurora/scheduler/base/Jobs.java     | 8 ++++----
 .../org/apache/aurora/scheduler/storage/log/LogManager.java  | 6 +++---
 .../org/apache/aurora/scheduler/storage/log/LogStorage.java  | 2 +-
 .../aurora/scheduler/thrift/SchedulerThriftInterface.java    | 2 +-
 .../scheduler/thrift/SchedulerThriftInterfaceTest.java       | 4 ++--
 .../scheduler/thrift/aop/ServerInfoInterceptorTest.java      | 4 ++--
 7 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 3237f8d..e92b27d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -416,7 +416,9 @@ task generateSources(dependsOn: ['bootstrapThrift', 'checkPython']) {
     thriftFiles.each { File file ->
       exec {
         executable = project.thrift
-        args = ['--gen', 'java:hashcode', '--gen', 'js:jquery', '-o', outputDir, file]
+        args = ['--gen', 'java:hashcode,private-members',
+                '--gen', 'js:jquery',
+                '-o', outputDir, file]
       }
     }
     exec {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/src/main/java/org/apache/aurora/scheduler/base/Jobs.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Jobs.java b/src/main/java/org/apache/aurora/scheduler/base/Jobs.java
index 7b10cf8..744d2b6 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Jobs.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Jobs.java
@@ -53,7 +53,7 @@ public final class Jobs {
       case INIT:
       case PENDING:
       case THROTTLED:
-        stats.pendingTaskCount++;
+        stats.setPendingTaskCount(stats.getPendingTaskCount() + 1);
         break;
 
       case ASSIGNED:
@@ -63,17 +63,17 @@ public final class Jobs {
       case KILLING:
       case DRAINING:
       case PREEMPTING:
-        stats.activeTaskCount++;
+        stats.setActiveTaskCount(stats.getActiveTaskCount() + 1);
         break;
 
       case KILLED:
       case FINISHED:
-        stats.finishedTaskCount++;
+        stats.setFinishedTaskCount(stats.getFinishedTaskCount() + 1);
         break;
 
       case LOST:
       case FAILED:
-        stats.failedTaskCount++;
+        stats.setFailedTaskCount(stats.getFailedTaskCount() + 1);
         break;
 
       default:

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/src/main/java/org/apache/aurora/scheduler/storage/log/LogManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/LogManager.java b/src/main/java/org/apache/aurora/scheduler/storage/log/LogManager.java
index bfca1d9..0b59043 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/LogManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/LogManager.java
@@ -198,10 +198,10 @@ public final class LogManager {
         return null;
       }
       FrameHeader header = frame.getHeader();
-      byte[][] chunks = new byte[header.chunkCount][];
+      byte[][] chunks = new byte[header.getChunkCount()][];
 
       digest.reset();
-      for (int i = 0; i < header.chunkCount; i++) {
+      for (int i = 0; i < header.getChunkCount(); i++) {
         if (!entries.hasNext()) {
           logBadFrame(header, i);
           return null;
@@ -240,7 +240,7 @@ public final class LogManager {
 
     private void logBadFrame(FrameHeader header, int chunkIndex) {
       LOG.info(String.format("Found an aborted transaction, required %d frames and found
%d",
-          header.chunkCount, chunkIndex));
+          header.getChunkCount(), chunkIndex));
       vars.badFramesRead.incrementAndGet();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
index e3c20cb..d3bf1f2 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/LogStorage.java
@@ -440,7 +440,7 @@ public class LogStorage implements NonVolatileStorage, DistributedSnapshotStore
         break;
 
       case SAVE_HOST_ATTRIBUTES:
-        HostAttributes attributes = op.getSaveHostAttributes().hostAttributes;
+        HostAttributes attributes = op.getSaveHostAttributes().getHostAttributes();
         // Prior to commit 5cf760b, the store would persist maintenance mode changes for
         // unknown hosts.  5cf760b began rejecting these, but the replicated log may still
         // contain entries with a null slave ID.

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/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 fedba15..dc0169a 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java
@@ -504,7 +504,7 @@ class SchedulerThriftInterface implements AuroraAdmin.Iface {
         new Function<ScheduledTask, ScheduledTask>() {
           @Override
           public ScheduledTask apply(ScheduledTask task) {
-            task.assignedTask.task.executorConfig = null;
+            task.getAssignedTask().getTask().unsetExecutorConfig();
             return task;
           }
         });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/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 cf98051..820a968 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
@@ -297,11 +297,11 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
     Response response = assertOkResponse(thrift.populateJobConfig(job.newBuilder()));
     assertEquals(
         ImmutableSet.of(sanitized.getJobConfig().getTaskConfig().newBuilder()),
-        response.result.getPopulateJobResult().getPopulatedDEPRECATED());
+        response.getResult().getPopulateJobResult().getPopulatedDEPRECATED());
 
     assertEquals(
         sanitized.getJobConfig().getTaskConfig().newBuilder(),
-        response.result.getPopulateJobResult().getTaskConfig());
+        response.getResult().getPopulateJobResult().getTaskConfig());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9e0b9ac4/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
index f100ada..840b3f8 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
@@ -78,7 +78,7 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
     expect(realThrift.getJobs(ROLE)).andReturn(response);
     control.replay();
 
-    assertNotNull(decoratedThrift.getJobs(ROLE).DEPRECATEDversion);
+    assertNotNull(decoratedThrift.getJobs(ROLE).getDEPRECATEDversion());
   }
 
   @Test
@@ -95,7 +95,7 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
 
     control.replay();
 
-    assertEquals(SERVER_INFO.newBuilder(), decoratedThrift.getJobs(ROLE).serverInfo);
+    assertEquals(SERVER_INFO.newBuilder(), decoratedThrift.getJobs(ROLE).getServerInfo());
   }
 
   private static Response okResponse(Result result) {


Mime
View raw message