From d3cdf57b58c7751fa023b9e6964244c5c115ef82 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Mon, 5 Dec 2016 08:58:44 -0800 Subject: [PATCH 1/2] Configurable HTTP compression. --- docs/content/configuration/broker.md | 3 ++- pom.xml | 2 +- .../io/druid/guice/http/DruidHttpClientConfig.java | 10 ++++++++++ .../java/io/druid/guice/http/HttpClientModule.java | 3 ++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/content/configuration/broker.md b/docs/content/configuration/broker.md index 230de4c4e8f4..fead78bf0cfb 100644 --- a/docs/content/configuration/broker.md +++ b/docs/content/configuration/broker.md @@ -37,7 +37,8 @@ Druid uses Jetty to serve HTTP requests. |`druid.server.http.numThreads`|Number of threads for HTTP requests.|10| |`druid.server.http.maxIdleTime`|The Jetty max idle time for a connection.|PT5m| |`druid.broker.http.numConnections`|Size of connection pool for the Broker to connect to historical and real-time nodes. If there are more queries than this number that all need to speak to the same node, then they will queue up.|20| -|`druid.broker.http.readTimeout`|The timeout for data reads.|PT15M| +|`druid.broker.http.compressionCodec`|Compression codec the Broker uses to communicate with historical and real-time nodes. May be "gzip" or "identity".|gzip| +|`druid.broker.http.readTimeout`|The timeout for data reads from historical and real-time nodes.|PT15M| #### Retry Policy diff --git a/pom.xml b/pom.xml index ee2c741478e2..efc19531c710 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ com.metamx http-client - 1.0.5 + 1.0.6 com.metamx diff --git a/server/src/main/java/io/druid/guice/http/DruidHttpClientConfig.java b/server/src/main/java/io/druid/guice/http/DruidHttpClientConfig.java index 600fb066446c..fba136e52331 100644 --- a/server/src/main/java/io/druid/guice/http/DruidHttpClientConfig.java +++ b/server/src/main/java/io/druid/guice/http/DruidHttpClientConfig.java @@ -30,6 +30,8 @@ public class DruidHttpClientConfig { + private final String DEFAULT_COMPRESSION_CODEC = "gzip"; + @JsonProperty @Min(0) private int numConnections = 20; @@ -41,6 +43,9 @@ public class DruidHttpClientConfig @Min(1) private int numMaxThreads = Math.max(10, (Runtime.getRuntime().availableProcessors() * 17) / 16 + 2) + 30; + @JsonProperty + private String compressionCodec = DEFAULT_COMPRESSION_CODEC; + public int getNumConnections() { return numConnections; @@ -55,4 +60,9 @@ public int getNumMaxThreads() { return numMaxThreads; } + + public String getCompressionCodec() + { + return compressionCodec; + } } diff --git a/server/src/main/java/io/druid/guice/http/HttpClientModule.java b/server/src/main/java/io/druid/guice/http/HttpClientModule.java index babc01f13522..b241c4bad04d 100644 --- a/server/src/main/java/io/druid/guice/http/HttpClientModule.java +++ b/server/src/main/java/io/druid/guice/http/HttpClientModule.java @@ -108,7 +108,8 @@ public HttpClient get() .builder() .withNumConnections(config.getNumConnections()) .withReadTimeout(config.getReadTimeout()) - .withWorkerCount(config.getNumMaxThreads()); + .withWorkerCount(config.getNumMaxThreads()) + .withCompressionCodec(HttpClientConfig.CompressionCodec.valueOf(config.getCompressionCodec().toUpperCase())); if (getSslContextBinding() != null) { builder.withSslContext(getSslContextBinding().getProvider().get()); From a31f3730a3f3981258a57d50564b3975c98611e1 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Wed, 7 Dec 2016 15:53:18 -0800 Subject: [PATCH 2/2] Call real-time nodes real-time processes in docs. --- docs/content/configuration/broker.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/configuration/broker.md b/docs/content/configuration/broker.md index fead78bf0cfb..55c1ccf8059e 100644 --- a/docs/content/configuration/broker.md +++ b/docs/content/configuration/broker.md @@ -36,9 +36,9 @@ Druid uses Jetty to serve HTTP requests. |--------|-----------|-------| |`druid.server.http.numThreads`|Number of threads for HTTP requests.|10| |`druid.server.http.maxIdleTime`|The Jetty max idle time for a connection.|PT5m| -|`druid.broker.http.numConnections`|Size of connection pool for the Broker to connect to historical and real-time nodes. If there are more queries than this number that all need to speak to the same node, then they will queue up.|20| -|`druid.broker.http.compressionCodec`|Compression codec the Broker uses to communicate with historical and real-time nodes. May be "gzip" or "identity".|gzip| -|`druid.broker.http.readTimeout`|The timeout for data reads from historical and real-time nodes.|PT15M| +|`druid.broker.http.numConnections`|Size of connection pool for the Broker to connect to historical and real-time processes. If there are more queries than this number that all need to speak to the same node, then they will queue up.|20| +|`druid.broker.http.compressionCodec`|Compression codec the Broker uses to communicate with historical and real-time processes. May be "gzip" or "identity".|gzip| +|`druid.broker.http.readTimeout`|The timeout for data reads from historical and real-time processes.|PT15M| #### Retry Policy