ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject [2/2] ambari git commit: AMBARI-15371. Increase the default http header size of the Ambari server to 64k. (mpapirkovskyy)
Date Fri, 11 Mar 2016 15:18:33 GMT
AMBARI-15371. Increase the default http header size of the Ambari server to 64k. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.2
Commit: 161cbd07b71611c78d83d513fa8a99fdf090b922
Parents: fe24628
Author: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Authored: Thu Mar 10 17:29:04 2016 +0200
Committer: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Committed: Fri Mar 11 16:47:04 2016 +0200

----------------------------------------------------------------------
 .../server/configuration/Configuration.java     | 21 ++++++++++++++++++++
 .../ambari/server/controller/AmbariServer.java  |  7 +++++++
 2 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/161cbd07/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 3fbcc6d..02f993e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -188,6 +188,11 @@ public class Configuration {
   public static final String SERVER_JDBC_URL_KEY = "server.jdbc.url";
   public static final String SERVER_JDBC_PROPERTIES_PREFIX = "server.jdbc.properties.";
 
+  public static final String SERVER_HTTP_REQUEST_HEADER_SIZE = "server.http.request.header.size";
+  public static final String SERVER_HTTP_RESPONSE_HEADER_SIZE = "server.http.response.header.size";
+  public static final int SERVER_HTTP_REQUEST_HEADER_SIZE_DEFAULT = 64*1024;
+  public static final int SERVER_HTTP_RESPONSE_HEADER_SIZE_DEFAULT = 64*1024;
+
   // Properties for stack upgrade (Rolling, Express)
   public static final String ROLLING_UPGRADE_MIN_STACK_KEY = "rolling.upgrade.min.stack";
   public static final String ROLLING_UPGRADE_MAX_STACK_KEY = "rolling.upgrade.max.stack";
@@ -1740,6 +1745,22 @@ public class Configuration {
     return customDbProperties;
   }
 
+  /**
+   * @return Custom property for request header size
+   */
+  public int getHttpRequestHeaderSize() {
+    return Integer.parseInt(properties.getProperty(
+        SERVER_HTTP_REQUEST_HEADER_SIZE, String.valueOf(SERVER_HTTP_REQUEST_HEADER_SIZE_DEFAULT)));
+  }
+
+  /**
+   * @return Custom property for response header size
+   */
+  public int getHttpResponseHeaderSize() {
+    return Integer.parseInt(properties.getProperty(
+        SERVER_HTTP_RESPONSE_HEADER_SIZE, String.valueOf(SERVER_HTTP_RESPONSE_HEADER_SIZE_DEFAULT)));
+  }
+
   public Map<String, String> getAmbariProperties() {
 
     Properties properties = readConfigFile();

http://git-wip-us.apache.org/repos/asf/ambari/blob/161cbd07/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index 2cd80aa..a4f3c30 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -381,6 +381,8 @@ public class AmbariServer {
       sslConnectorTwoWay.setKeystoreType(configsMap.get(Configuration.KSTR_TYPE_KEY));
       sslConnectorTwoWay.setTruststoreType(configsMap.get(Configuration.TSTR_TYPE_KEY));
       sslConnectorTwoWay.setNeedClientAuth(configs.getTwoWaySsl());
+      sslConnectorTwoWay.setRequestHeaderSize(configs.getHttpRequestHeaderSize());
+      sslConnectorTwoWay.setResponseHeaderSize(configs.getHttpResponseHeaderSize());
 
       //SSL Context Factory
       SslContextFactory contextFactoryOneWay = new SslContextFactory(true);
@@ -397,6 +399,8 @@ public class AmbariServer {
       //Secured connector for 1-way auth
       SslSelectChannelConnector sslConnectorOneWay = new SslSelectChannelConnector(contextFactoryOneWay);
       sslConnectorOneWay.setPort(configs.getOneWayAuthPort());
+      sslConnectorOneWay.setRequestHeaderSize(configs.getHttpRequestHeaderSize());
+      sslConnectorOneWay.setResponseHeaderSize(configs.getHttpResponseHeaderSize());
 
       // because there are two connectors sharing the same pool, cut each's
       // acceptors in half
@@ -498,6 +502,9 @@ public class AmbariServer {
         apiConnector.setMaxIdleTime(configs.getConnectionMaxIdleTime());
       }
 
+      apiConnector.setRequestHeaderSize(configs.getHttpRequestHeaderSize());
+      apiConnector.setResponseHeaderSize(configs.getHttpResponseHeaderSize());
+
       // Client Jetty thread pool
       configureJettyThreadPool(server, apiConnector.getAcceptors(), "qtp-ambari-client",
configs.getClientThreadPoolSize());
       server.addConnector(apiConnector);


Mime
View raw message