From ba3d86c97210343c69aaa00a4925610a5ae1c437 Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Wed, 22 Jun 2022 22:38:12 +0800 Subject: [PATCH] HBASE-27141 Upgrade hbase-thirdparty dependency to 4.1.1 (#4552) Signed-off-by: Andrew Purtell Signed-off-by: Pankaj Kumar (cherry picked from commit 9bae50f83c6c300d8952527bece28c3d2c13e179) Conflicts: pom.xml --- .../main/java/org/apache/hadoop/hbase/http/HttpServer.java | 5 ++++- .../main/java/org/apache/hadoop/hbase/util/JSONBean.java | 2 +- hbase-protocol-shaded/pom.xml | 2 +- .../main/java/org/apache/hadoop/hbase/thrift/Constants.java | 5 ++++- pom.xml | 6 +++--- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java index d2437a1e597..8b4890fa54a 100644 --- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java +++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java @@ -107,7 +107,10 @@ public class HttpServer implements FilterContainer { private static final Logger LOG = LoggerFactory.getLogger(HttpServer.class); private static final String EMPTY_STRING = ""; - private static final int DEFAULT_MAX_HEADER_SIZE = 64 * 1024; // 64K + // Jetty's max header size is Character.MAX_VALUE - 1, See ArrayTernaryTrie for more details + // And in newer jetty version, they add a check when creating a server so we must follow this + // limitation otherwise the UTs will fail + private static final int DEFAULT_MAX_HEADER_SIZE = Character.MAX_VALUE - 1; static final String FILTER_INITIALIZERS_PROPERTY = "hbase.http.filter.initializers"; static final String HTTP_MAX_THREADS = "hbase.http.max.threads"; diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java index 9a9761a90a4..970ec547c1c 100644 --- a/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java +++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java @@ -57,7 +57,7 @@ public class JSONBean { private static final String COMMA = ","; private static final String ASTERICK = "*"; private static final Logger LOG = LoggerFactory.getLogger(JSONBean.class); - private static final Gson GSON = GsonUtil.createGson().create(); + private static final Gson GSON = GsonUtil.createGsonWithDisableHtmlEscaping().create(); /** * Use dumping out mbeans as JSON. diff --git a/hbase-protocol-shaded/pom.xml b/hbase-protocol-shaded/pom.xml index 88c17cd979a..423f8d9351f 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -34,7 +34,7 @@ - 3.17.3 + 3.21.1