aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject aurora git commit: Remove ServerInfo.thriftAPIVersion
Date Thu, 17 Dec 2015 18:59:51 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 0c99c349d -> c934a1258


Remove ServerInfo.thriftAPIVersion

Bugs closed: AURORA-1553

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


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

Branch: refs/heads/master
Commit: c934a1258a7897e87ff96bdc51eed3b99747a6c1
Parents: 0c99c34
Author: Bill Farner <wfarner@apache.org>
Authored: Thu Dec 17 10:59:20 2015 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Thu Dec 17 10:59:46 2015 -0800

----------------------------------------------------------------------
 api/src/main/thrift/org/apache/aurora/gen/api.thrift     | 11 -----------
 api/src/main/thrift/org/apache/aurora/gen/storage.thrift |  1 -
 .../org/apache/aurora/scheduler/app/SchedulerMain.java   |  2 --
 .../aurora/scheduler/storage/log/SnapshotStoreImpl.java  |  6 +-----
 .../org/apache/aurora/scheduler/app/SchedulerIT.java     |  2 --
 .../apache/aurora/scheduler/http/AbstractJettyTest.java  |  1 -
 .../aurora/scheduler/storage/backup/RecoveryTest.java    | 11 +++++------
 .../scheduler/storage/log/SnapshotStoreImplTest.java     |  5 +----
 .../scheduler/thrift/aop/ServerInfoInterceptorTest.java  |  5 +----
 .../python/apache/aurora/client/api/test_restarter.py    |  3 +--
 src/test/python/apache/aurora/client/cli/util.py         |  8 ++------
 src/test/python/apache/aurora/common/test_transport.py   |  3 +--
 12 files changed, 12 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/api/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/api/src/main/thrift/org/apache/aurora/gen/api.thrift b/api/src/main/thrift/org/apache/aurora/gen/api.thrift
index ad74685..bdfadbb 100644
--- a/api/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/api/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -33,15 +33,6 @@ enum ResponseCode {
   ERROR_TRANSIENT = 6
 }
 
-const i32 THRIFT_API_VERSION = 3
-
-struct APIVersion {
-  1: required i32 major
-}
-
-// Scheduler Thrift API Version. Increment this when breaking backwards compatibility.
-const APIVersion CURRENT_API_VERSION = {'major': THRIFT_API_VERSION}
-
 // Aurora executor framework name.
 const string AURORA_EXECUTOR_NAME = 'AuroraExecutor'
 
@@ -915,7 +906,6 @@ struct GetJobUpdateDiffResult {
 /** Information about the scheduler. */
 struct ServerInfo {
   1: string clusterName
-  2: i32 thriftAPIVersion
   /** A url prefix for job container stats. */
   3: string statsUrlPrefix
 }
@@ -931,7 +921,6 @@ union Result {
   9: QueryRecoveryResult queryRecoveryResult
   10: MaintenanceStatusResult maintenanceStatusResult
   11: EndMaintenanceResult endMaintenanceResult
-  15: APIVersion getVersionResult
   16: AcquireLockResult acquireLockResult
   17: RoleSummaryResult roleSummaryResult
   18: JobSummaryResult jobSummaryResult

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
----------------------------------------------------------------------
diff --git a/api/src/main/thrift/org/apache/aurora/gen/storage.thrift b/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
index 624076d..6dc4614 100644
--- a/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
+++ b/api/src/main/thrift/org/apache/aurora/gen/storage.thrift
@@ -127,7 +127,6 @@ struct StoredCronJob {
 
 struct SchedulerMetadata {
   1: string frameworkId
-  7: api.APIVersion version
   8: map<string, string> details
 }
 

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
index ff886d9..e8bf6bc 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
@@ -70,7 +70,6 @@ import org.apache.aurora.scheduler.zookeeper.guice.client.ZooKeeperClientModule.
 import org.apache.aurora.scheduler.zookeeper.guice.client.flagged.FlaggedClientConfig;
 
 import static org.apache.aurora.common.logging.RootLogConfig.Configuration;
-import static org.apache.aurora.gen.apiConstants.THRIFT_API_VERSION;
 
 /**
  * Launcher for the aurora scheduler.
@@ -186,7 +185,6 @@ public class SchedulerMain {
                 IServerInfo.build(
                     new ServerInfo()
                         .setClusterName(CLUSTER_NAME.get())
-                        .setThriftAPIVersion(THRIFT_API_VERSION)
                         .setStatsUrlPrefix(STATS_URL_PREFIX.get())));
           }
         });

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
index 3ede9a0..3077c37 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java
@@ -55,8 +55,6 @@ import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
 import static java.util.Objects.requireNonNull;
 
-import static org.apache.aurora.gen.apiConstants.CURRENT_API_VERSION;
-
 /**
  * Snapshot store implementation that delegates to underlying snapshot stores by
  * extracting/applying fields in a snapshot thrift struct.
@@ -259,9 +257,7 @@ public class SnapshotStoreImpl implements SnapshotStore<Snapshot>
{
 
       SchedulerMetadata metadata = new SchedulerMetadata()
           .setFrameworkId(storeProvider.getSchedulerStore().fetchFrameworkId().orNull())
-          .setVersion(CURRENT_API_VERSION);
-
-      metadata.setDetails(buildInfo.getProperties());
+          .setDetails(buildInfo.getProperties());
 
       snapshot.setSchedulerMetadata(metadata);
       snapshot.setTimestamp(timestamp);

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
index 35a4d62..d53ec6a 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
@@ -99,7 +99,6 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 import static org.apache.aurora.common.testing.easymock.EasyMockTest.createCapture;
-import static org.apache.aurora.gen.apiConstants.THRIFT_API_VERSION;
 import static org.apache.mesos.Protos.FrameworkInfo;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createControl;
@@ -193,7 +192,6 @@ public class SchedulerIT extends BaseZooKeeperTest {
             IServerInfo.build(
                 new ServerInfo()
                     .setClusterName(CLUSTER_NAME)
-                    .setThriftAPIVersion(THRIFT_API_VERSION)
                     .setStatsUrlPrefix(STATS_URL_PREFIX)));
       }
     };

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java b/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
index 39f7188..152af0d 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java
@@ -114,7 +114,6 @@ public abstract class AbstractJettyTest extends EasyMockTest {
             bind(Storage.class).toInstance(storage.storage);
             bind(IServerInfo.class).toInstance(IServerInfo.build(new ServerInfo()
                 .setClusterName("unittest")
-                .setThriftAPIVersion(100)
                 .setStatsUrlPrefix("none")));
             bind(TaskGroupsSettings.class).toInstance(
                 new TaskGroupsSettings(

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java b/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
index 97647ac..172dd20 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java
@@ -17,6 +17,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.concurrent.ScheduledExecutorService;
 
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
 import org.apache.aurora.common.base.Command;
@@ -48,7 +49,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
-import static org.apache.aurora.gen.apiConstants.CURRENT_API_VERSION;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.expect;
 import static org.junit.Assert.assertEquals;
@@ -156,11 +156,10 @@ public class RecoveryTest extends EasyMockTest {
 
   private static Snapshot makeSnapshot(IScheduledTask... tasks) {
     SchedulerMetadata metadata = new SchedulerMetadata()
-        .setVersion(CURRENT_API_VERSION);
-    metadata.setDetails(com.google.common.collect.Maps.newHashMap());
-    metadata.getDetails().put(FakeBuildInfo.DATE, FakeBuildInfo.DATE);
-    metadata.getDetails().put(FakeBuildInfo.GIT_REVISION, FakeBuildInfo.GIT_REVISION);
-    metadata.getDetails().put(FakeBuildInfo.GIT_TAG, FakeBuildInfo.GIT_TAG);
+        .setDetails(ImmutableMap.of(
+            FakeBuildInfo.DATE, FakeBuildInfo.DATE,
+            FakeBuildInfo.GIT_REVISION, FakeBuildInfo.GIT_REVISION,
+            FakeBuildInfo.GIT_TAG, FakeBuildInfo.GIT_TAG));
 
     return new Snapshot()
         .setHostAttributes(ImmutableSet.of())

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
index 02400f0..806f50d 100644
--- a/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java
@@ -61,7 +61,6 @@ import org.junit.Before;
 import org.junit.Test;
 
 import static org.apache.aurora.common.util.testing.FakeBuildInfo.generateBuildInfo;
-import static org.apache.aurora.gen.apiConstants.CURRENT_API_VERSION;
 import static org.easymock.EasyMock.expect;
 import static org.junit.Assert.assertEquals;
 
@@ -110,9 +109,7 @@ public class SnapshotStoreImplTest extends EasyMockTest {
         .setToken("lockId")
         .setUser("testUser")
         .setTimestampMs(12345L));
-    SchedulerMetadata metadata = new SchedulerMetadata()
-        .setFrameworkId(frameworkId)
-        .setVersion(CURRENT_API_VERSION);
+    SchedulerMetadata metadata = new SchedulerMetadata().setFrameworkId(frameworkId);
     metadata.setDetails(Maps.newHashMap());
     metadata.getDetails().put(FakeBuildInfo.DATE, FakeBuildInfo.DATE);
     metadata.getDetails().put(FakeBuildInfo.GIT_REVISION, FakeBuildInfo.GIT_REVISION);

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/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 3a80305..b975277 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
@@ -43,7 +43,6 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
   private static final IServerInfo SERVER_INFO = IServerInfo.build(
       new ServerInfo()
           .setClusterName("test")
-          .setThriftAPIVersion(1)
           .setStatsUrlPrefix("fake_url"));
 
   private ServerInfoInterceptor interceptor;
@@ -68,9 +67,7 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
 
   @Test
   public void testServerInfoIsSet() throws Exception {
-    ServerInfo previousServerInfo =
-        new ServerInfo().setClusterName("FAKECLUSTER").setThriftAPIVersion(100000);
-
+    ServerInfo previousServerInfo = new ServerInfo().setClusterName("FAKECLUSTER");
     Response response = okResponse(
         Result.getJobsResult(new GetJobsResult().setConfigs(ImmutableSet.of())))
         .setServerInfo(previousServerInfo);

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/python/apache/aurora/client/api/test_restarter.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_restarter.py b/src/test/python/apache/aurora/client/api/test_restarter.py
index 8ab21a8..a75981c 100644
--- a/src/test/python/apache/aurora/client/api/test_restarter.py
+++ b/src/test/python/apache/aurora/client/api/test_restarter.py
@@ -22,7 +22,6 @@ from apache.aurora.common.cluster import Cluster
 from ..fake_scheduler_proxy import FakeSchedulerProxy
 
 from gen.apache.aurora.api.AuroraSchedulerManager import Client as scheduler_client
-from gen.apache.aurora.api.constants import THRIFT_API_VERSION
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     Response,
@@ -52,7 +51,7 @@ def make_response(code=ResponseCode.OK, message='test', result=None):
     responseCode=code,
     details=[ResponseDetail(message=message)],
     result=result,
-    serverInfo=ServerInfo(clusterName='test', thriftAPIVersion=THRIFT_API_VERSION))
+    serverInfo=ServerInfo(clusterName='test'))
 
 
 class TestRestarter(MoxTestBase):

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/python/apache/aurora/client/cli/util.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/util.py b/src/test/python/apache/aurora/client/cli/util.py
index 4b5ef4d..c7aa5cc 100644
--- a/src/test/python/apache/aurora/client/cli/util.py
+++ b/src/test/python/apache/aurora/client/cli/util.py
@@ -25,7 +25,7 @@ from apache.aurora.common.clusters import CLUSTERS, Clusters
 
 from ...api_util import SchedulerProxyApiSpec, SchedulerThriftApiSpec
 
-from gen.apache.aurora.api.constants import ACTIVE_STATES, CURRENT_API_VERSION
+from gen.apache.aurora.api.constants import ACTIVE_STATES
 from gen.apache.aurora.api.ttypes import (
     AssignedTask,
     ExecutorConfig,
@@ -38,7 +38,6 @@ from gen.apache.aurora.api.ttypes import (
     ScheduledTask,
     ScheduleStatus,
     ScheduleStatusResult,
-    ServerInfo,
     TaskConfig,
     TaskEvent,
     TaskQuery
@@ -151,10 +150,7 @@ class AuroraClientCommandTest(unittest.TestCase):
 
   @classmethod
   def create_blank_response(cls, code, msg):
-    return Response(
-        responseCode=code,
-        details=[ResponseDetail(message=msg)],
-        serverInfo=ServerInfo(thriftAPIVersion=CURRENT_API_VERSION.major))
+    return Response(responseCode=code, details=[ResponseDetail(message=msg)])
 
   @classmethod
   def create_simple_success_response(cls):

http://git-wip-us.apache.org/repos/asf/aurora/blob/c934a125/src/test/python/apache/aurora/common/test_transport.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/common/test_transport.py b/src/test/python/apache/aurora/common/test_transport.py
index 835bb3d..1f589a9 100644
--- a/src/test/python/apache/aurora/common/test_transport.py
+++ b/src/test/python/apache/aurora/common/test_transport.py
@@ -31,7 +31,7 @@ from gen.apache.aurora.api.ttypes import Response, ResponseCode, ServerInfo
 
 class ReadOnlySchedulerHandler(object):
   def getRoleSummary(self):  # noqa
-    server_info = ServerInfo(clusterName='west', thriftAPIVersion=3)
+    server_info = ServerInfo(clusterName='west')
     return Response(responseCode=ResponseCode.OK, serverInfo=server_info)
 
 
@@ -55,7 +55,6 @@ def test_request_transport_integration():
   assert response is not None
   assert response.responseCode == ResponseCode.OK
   assert response.serverInfo.clusterName == 'west'
-  assert response.serverInfo.thriftAPIVersion == 3
 
   transport.close()
 


Mime
View raw message