From 8c84793d2214239a3e49b4582df1c2869ef32378 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 22 Aug 2017 13:33:08 -0700 Subject: [PATCH] HBASE-18224 Upgrade Jetty --- hbase-common/src/main/resources/hbase-default.xml | 2 +- .../apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java | 4 ++-- .../java/org/apache/hadoop/hbase/http/TestHttpServer.java | 5 +++-- .../java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java | 2 +- .../org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java | 4 ++-- .../org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java | 4 ++-- pom.xml | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml index d7944f63e84..01c4c5809e5 100644 --- a/hbase-common/src/main/resources/hbase-default.xml +++ b/hbase-common/src/main/resources/hbase-default.xml @@ -1602,7 +1602,7 @@ possible configurations would overwhelm and obscure the important. hbase.http.max.threads - 10 + 16 The maximum number of threads that the HTTP Server will create in its ThreadPool. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java index 680a902c6f8..185df410dfd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeLoadBalancer.java @@ -97,12 +97,12 @@ public class FavoredNodeLoadBalancer extends BaseLoadBalancer implements Favored LOG.warn("Not running balancer since exception was thrown " + ie); return plans; } - Map serverNameToServerNameWithoutCode = new HashMap<>(); + // This is not used? Findbugs says so: Map serverNameToServerNameWithoutCode = new HashMap<>(); Map serverNameWithoutCodeToServerName = new HashMap<>(); ServerManager serverMgr = super.services.getServerManager(); for (ServerName sn: serverMgr.getOnlineServersList()) { ServerName s = ServerName.valueOf(sn.getHostname(), sn.getPort(), ServerName.NON_STARTCODE); - serverNameToServerNameWithoutCode.put(sn, s); + // FindBugs complains about useless store! serverNameToServerNameWithoutCode.put(sn, s); serverNameWithoutCodeToServerName.put(s, sn); } for (Map.Entry> entry : clusterState.entrySet()) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java index 31b5b8d3268..e9a56ff7485 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java @@ -74,7 +74,8 @@ public class TestHttpServer extends HttpServerFunctionalTest { private static final Log LOG = LogFactory.getLog(TestHttpServer.class); private static HttpServer server; private static URL baseUrl; - private static final int MAX_THREADS = 10; + // jetty 9.4.x needs this many threads to start, even in the small. + static final int MAX_THREADS = 16; @SuppressWarnings("serial") public static class EchoMapServlet extends HttpServlet { @@ -150,7 +151,7 @@ public class TestHttpServer extends HttpServerFunctionalTest { @BeforeClass public static void setup() throws Exception { Configuration conf = new Configuration(); - conf.setInt(HttpServer.HTTP_MAX_THREADS, 10); + conf.setInt(HttpServer.HTTP_MAX_THREADS, MAX_THREADS); server = createTestServer(conf); server.addServlet("echo", "/echo", EchoServlet.class); server.addServlet("echomap", "/echomap", EchoMapServlet.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java index 44d122ab0da..b599350cc66 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java @@ -62,7 +62,7 @@ public class TestSSLHttpServer extends HttpServerFunctionalTest { @BeforeClass public static void setup() throws Exception { conf = new Configuration(); - conf.setInt(HttpServer.HTTP_MAX_THREADS, 10); + conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS); File base = new File(BASEDIR); FileUtil.fullyDelete(base); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java index a84895f81be..4fad03139ae 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSpnegoHttpServer.java @@ -168,7 +168,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest { Configuration conf = new Configuration(); KerberosName.setRules("DEFAULT"); - conf.setInt(HttpServer.HTTP_MAX_THREADS, 10); + conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS); // Enable Kerberos (pre-req) conf.set("hbase.security.authentication", "kerberos"); @@ -245,7 +245,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest { @Test(expected = IllegalArgumentException.class) public void testMissingConfigurationThrowsException() throws Exception { Configuration conf = new Configuration(); - conf.setInt(HttpServer.HTTP_MAX_THREADS, 10); + conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS); // Enable Kerberos (pre-req) conf.set("hbase.security.authentication", "kerberos"); // Intentionally skip keytab and principal diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java index 70cb66af7f3..74c7690d2e0 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java @@ -112,12 +112,12 @@ public class TestThriftHttpServer { try { runThriftServer(1024 * 63); } catch (TTransportException tex) { - assertFalse(tex.getMessage().equals("HTTP Response code: 413")); + assertFalse(tex.getMessage().equals("HTTP Response code: 431")); } // Test thrift server with HTTP header length more than 64k, expect an exception exception.expect(TTransportException.class); - exception.expectMessage("HTTP Response code: 413"); + exception.expectMessage("HTTP Response code: 431"); runThriftServer(1024 * 64); } diff --git a/pom.xml b/pom.xml index 0ac0f270071..be0be9970ae 100644 --- a/pom.xml +++ b/pom.xml @@ -1354,7 +1354,7 @@ 3.2.1 2.23.2 2.2.12 - 9.3.8.v20160314 + 9.4.6.v20170531 9.2.19.v20160908 3.1.0 2.0.1