aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kevi...@apache.org
Subject git commit: GZIP HTTP thrift API responses
Date Tue, 25 Mar 2014 18:08:52 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 7b1b4dd00 -> 9ff7264f4


GZIP HTTP thrift API responses

Testing Done:
Verified API responses are gzipped.

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


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

Branch: refs/heads/master
Commit: 9ff7264f43c6288a56b43d4ddfd3f18c356ce0f4
Parents: 7b1b4dd
Author: Kevin Sweeney <kevints@apache.org>
Authored: Tue Mar 25 11:08:34 2014 -0700
Committer: Kevin Sweeney <kevints@apache.org>
Committed: Tue Mar 25 11:08:34 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/aurora/scheduler/thrift/ThriftModule.java    | 4 ++++
 .../resources/org/apache/aurora/scheduler/http/ui/js/services.js | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9ff7264f/src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java b/src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java
index 1211353..c14d5c2 100644
--- a/src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java
@@ -23,6 +23,7 @@ import com.twitter.common.application.modules.LifecycleModule;
 
 import org.apache.aurora.gen.AuroraAdmin;
 import org.apache.aurora.scheduler.thrift.aop.AopModule;
+import org.mortbay.servlet.GzipFilter;
 
 /**
  * Binding module to configure a thrift server.
@@ -36,6 +37,9 @@ public class ThriftModule extends AbstractModule {
     LifecycleModule.bindServiceRunner(binder(), ThriftServerLauncher.class);
 
     Registration.registerServlet(binder(), "/api", SchedulerAPIServlet.class, true);
+    // NOTE: GzipFilter is applied only to /api instead of globally because the Jersey-managed
+    // servlets from ServletModule have a conflicting filter applied to them.
+    Registration.registerServletFilter(binder(), GzipFilter.class, "/api");
 
     install(new AopModule());
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/9ff7264f/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 81cd12c..8681bbe 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
@@ -19,7 +19,7 @@ auroraUI.factory(
 
       getSchedulerClient: function () {
         if (!this.schedulerClient) {
-          var transport = new Thrift.Transport("/api/");
+          var transport = new Thrift.Transport("/api");
           var protocol = new Thrift.Protocol(transport);
           this.schedulerClient = new ReadOnlySchedulerClient(protocol);
           return this.schedulerClient;


Mime
View raw message