HBASE-18224 Upgrade Jetty
This commit is contained in:
parent
e2ce252b59
commit
8c84793d22
|
@ -1602,7 +1602,7 @@ possible configurations would overwhelm and obscure the important.
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>hbase.http.max.threads</name>
|
<name>hbase.http.max.threads</name>
|
||||||
<value>10</value>
|
<value>16</value>
|
||||||
<description>
|
<description>
|
||||||
The maximum number of threads that the HTTP Server will create in its
|
The maximum number of threads that the HTTP Server will create in its
|
||||||
ThreadPool.
|
ThreadPool.
|
||||||
|
|
|
@ -97,12 +97,12 @@ public class FavoredNodeLoadBalancer extends BaseLoadBalancer implements Favored
|
||||||
LOG.warn("Not running balancer since exception was thrown " + ie);
|
LOG.warn("Not running balancer since exception was thrown " + ie);
|
||||||
return plans;
|
return plans;
|
||||||
}
|
}
|
||||||
Map<ServerName, ServerName> serverNameToServerNameWithoutCode = new HashMap<>();
|
// This is not used? Findbugs says so: Map<ServerName, ServerName> serverNameToServerNameWithoutCode = new HashMap<>();
|
||||||
Map<ServerName, ServerName> serverNameWithoutCodeToServerName = new HashMap<>();
|
Map<ServerName, ServerName> serverNameWithoutCodeToServerName = new HashMap<>();
|
||||||
ServerManager serverMgr = super.services.getServerManager();
|
ServerManager serverMgr = super.services.getServerManager();
|
||||||
for (ServerName sn: serverMgr.getOnlineServersList()) {
|
for (ServerName sn: serverMgr.getOnlineServersList()) {
|
||||||
ServerName s = ServerName.valueOf(sn.getHostname(), sn.getPort(), ServerName.NON_STARTCODE);
|
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);
|
serverNameWithoutCodeToServerName.put(s, sn);
|
||||||
}
|
}
|
||||||
for (Map.Entry<ServerName, List<HRegionInfo>> entry : clusterState.entrySet()) {
|
for (Map.Entry<ServerName, List<HRegionInfo>> entry : clusterState.entrySet()) {
|
||||||
|
|
|
@ -74,7 +74,8 @@ public class TestHttpServer extends HttpServerFunctionalTest {
|
||||||
private static final Log LOG = LogFactory.getLog(TestHttpServer.class);
|
private static final Log LOG = LogFactory.getLog(TestHttpServer.class);
|
||||||
private static HttpServer server;
|
private static HttpServer server;
|
||||||
private static URL baseUrl;
|
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")
|
@SuppressWarnings("serial")
|
||||||
public static class EchoMapServlet extends HttpServlet {
|
public static class EchoMapServlet extends HttpServlet {
|
||||||
|
@ -150,7 +151,7 @@ public class TestHttpServer extends HttpServerFunctionalTest {
|
||||||
|
|
||||||
@BeforeClass public static void setup() throws Exception {
|
@BeforeClass public static void setup() throws Exception {
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
|
conf.setInt(HttpServer.HTTP_MAX_THREADS, MAX_THREADS);
|
||||||
server = createTestServer(conf);
|
server = createTestServer(conf);
|
||||||
server.addServlet("echo", "/echo", EchoServlet.class);
|
server.addServlet("echo", "/echo", EchoServlet.class);
|
||||||
server.addServlet("echomap", "/echomap", EchoMapServlet.class);
|
server.addServlet("echomap", "/echomap", EchoMapServlet.class);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class TestSSLHttpServer extends HttpServerFunctionalTest {
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup() throws Exception {
|
public static void setup() throws Exception {
|
||||||
conf = new Configuration();
|
conf = new Configuration();
|
||||||
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
|
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
|
||||||
|
|
||||||
File base = new File(BASEDIR);
|
File base = new File(BASEDIR);
|
||||||
FileUtil.fullyDelete(base);
|
FileUtil.fullyDelete(base);
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest {
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
KerberosName.setRules("DEFAULT");
|
KerberosName.setRules("DEFAULT");
|
||||||
|
|
||||||
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
|
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
|
||||||
|
|
||||||
// Enable Kerberos (pre-req)
|
// Enable Kerberos (pre-req)
|
||||||
conf.set("hbase.security.authentication", "kerberos");
|
conf.set("hbase.security.authentication", "kerberos");
|
||||||
|
@ -245,7 +245,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest {
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
public void testMissingConfigurationThrowsException() throws Exception {
|
public void testMissingConfigurationThrowsException() throws Exception {
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
|
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
|
||||||
// Enable Kerberos (pre-req)
|
// Enable Kerberos (pre-req)
|
||||||
conf.set("hbase.security.authentication", "kerberos");
|
conf.set("hbase.security.authentication", "kerberos");
|
||||||
// Intentionally skip keytab and principal
|
// Intentionally skip keytab and principal
|
||||||
|
|
|
@ -112,12 +112,12 @@ public class TestThriftHttpServer {
|
||||||
try {
|
try {
|
||||||
runThriftServer(1024 * 63);
|
runThriftServer(1024 * 63);
|
||||||
} catch (TTransportException tex) {
|
} 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
|
// Test thrift server with HTTP header length more than 64k, expect an exception
|
||||||
exception.expect(TTransportException.class);
|
exception.expect(TTransportException.class);
|
||||||
exception.expectMessage("HTTP Response code: 413");
|
exception.expectMessage("HTTP Response code: 431");
|
||||||
runThriftServer(1024 * 64);
|
runThriftServer(1024 * 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -1354,7 +1354,7 @@
|
||||||
<metrics-core.version>3.2.1</metrics-core.version>
|
<metrics-core.version>3.2.1</metrics-core.version>
|
||||||
<jackson.version>2.23.2</jackson.version>
|
<jackson.version>2.23.2</jackson.version>
|
||||||
<jaxb-api.version>2.2.12</jaxb-api.version>
|
<jaxb-api.version>2.2.12</jaxb-api.version>
|
||||||
<jetty.version>9.3.8.v20160314</jetty.version>
|
<jetty.version>9.4.6.v20170531</jetty.version>
|
||||||
<jetty-jsp.version>9.2.19.v20160908</jetty-jsp.version>
|
<jetty-jsp.version>9.2.19.v20160908</jetty-jsp.version>
|
||||||
<servlet.api.version>3.1.0</servlet.api.version>
|
<servlet.api.version>3.1.0</servlet.api.version>
|
||||||
<wx.rs.api.version>2.0.1</wx.rs.api.version>
|
<wx.rs.api.version>2.0.1</wx.rs.api.version>
|
||||||
|
|
Loading…
Reference in New Issue