From 192b24c35500c79b7f3a82ae51a7a9e042b43132 Mon Sep 17 00:00:00 2001 From: xvrl Date: Wed, 22 May 2013 17:16:56 -0700 Subject: [PATCH] enable gzip compression for HTTP requests --- client/pom.xml | 1 - client/src/main/java/com/metamx/druid/http/BrokerNode.java | 2 ++ pom.xml | 5 +++++ server/src/main/java/com/metamx/druid/http/MasterMain.java | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/pom.xml b/client/pom.xml index fa5212a7c48..c614c136163 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -91,7 +91,6 @@ org.mortbay.jetty jetty-util - 6.1.26 com.google.guava diff --git a/client/src/main/java/com/metamx/druid/http/BrokerNode.java b/client/src/main/java/com/metamx/druid/http/BrokerNode.java index 191c2ea4ad8..75b69fe5d94 100644 --- a/client/src/main/java/com/metamx/druid/http/BrokerNode.java +++ b/client/src/main/java/com/metamx/druid/http/BrokerNode.java @@ -58,6 +58,7 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.x.discovery.ServiceDiscovery; import org.mortbay.jetty.servlet.Context; import org.mortbay.jetty.servlet.ServletHolder; +import org.mortbay.servlet.GzipFilter; import org.skife.config.ConfigurationObjectFactory; import java.util.List; @@ -214,6 +215,7 @@ public class BrokerNode extends QueryableNode new ServletHolder(new QueryServlet(getJsonMapper(), getSmileMapper(), texasRanger, getEmitter(), getRequestLogger())), "/druid/v2/*" ); + root.addFilter(GzipFilter.class, "/*", 0); root.addEventListener(new GuiceServletConfig(injector)); root.addFilter(GuiceFilter.class, "/druid/v2/datasources/*", 0); diff --git a/pom.xml b/pom.xml index 5544c640b19..c75cbaab46e 100644 --- a/pom.xml +++ b/pom.xml @@ -260,6 +260,11 @@ + + org.mortbay.jetty + jetty-util + 6.1.26 + joda-time joda-time diff --git a/server/src/main/java/com/metamx/druid/http/MasterMain.java b/server/src/main/java/com/metamx/druid/http/MasterMain.java index c2132ab862b..f6be1370e1d 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterMain.java +++ b/server/src/main/java/com/metamx/druid/http/MasterMain.java @@ -77,6 +77,7 @@ import org.mortbay.jetty.servlet.Context; import org.mortbay.jetty.servlet.DefaultServlet; import org.mortbay.jetty.servlet.FilterHolder; import org.mortbay.jetty.servlet.ServletHolder; +import org.mortbay.servlet.GzipFilter; import org.skife.config.ConfigurationObjectFactory; import org.skife.jdbi.v2.DBI; @@ -290,6 +291,7 @@ public class MasterMain root.addServlet(new ServletHolder(new StatusServlet()), "/status"); root.addServlet(new ServletHolder(new DefaultServlet()), "/*"); root.addEventListener(new GuiceServletConfig(injector)); + root.addFilter(GzipFilter.class, "/*", 0); root.addFilter( new FilterHolder( new RedirectFilter(