Merge -c 1189314 from trunk to branch-0.23 to fix HADOOP-7764.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1189315 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b211fc72cc
commit
4cfc89a9a4
|
@ -665,6 +665,9 @@ Release 0.23.0 - Unreleased
|
||||||
HADOOP-7744. Ensure failed tests exit with proper error code. (Jonathan
|
HADOOP-7744. Ensure failed tests exit with proper error code. (Jonathan
|
||||||
Eagles via acmurthy)
|
Eagles via acmurthy)
|
||||||
|
|
||||||
|
HADOOP-7764. Allow HttpServer to set both ACL list and path spec filters.
|
||||||
|
(Jonathan Eagles via acmurthy)
|
||||||
|
|
||||||
Release 0.22.0 - Unreleased
|
Release 0.22.0 - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class HttpServer implements FilterContainer {
|
||||||
|
|
||||||
public HttpServer(String name, String bindAddress, int port,
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
boolean findPort, Configuration conf, Connector connector) throws IOException {
|
boolean findPort, Configuration conf, Connector connector) throws IOException {
|
||||||
this(name, bindAddress, port, findPort, conf, null, connector);
|
this(name, bindAddress, port, findPort, conf, null, connector, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,11 +141,7 @@ public class HttpServer implements FilterContainer {
|
||||||
*/
|
*/
|
||||||
public HttpServer(String name, String bindAddress, int port,
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
boolean findPort, Configuration conf, String[] pathSpecs) throws IOException {
|
boolean findPort, Configuration conf, String[] pathSpecs) throws IOException {
|
||||||
this(name, bindAddress, port, findPort, conf, null, null);
|
this(name, bindAddress, port, findPort, conf, null, null, pathSpecs);
|
||||||
for (String path : pathSpecs) {
|
|
||||||
LOG.info("adding path spec: " + path);
|
|
||||||
addFilterPathMapping(path, webAppContext);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -159,19 +155,20 @@ public class HttpServer implements FilterContainer {
|
||||||
*/
|
*/
|
||||||
public HttpServer(String name, String bindAddress, int port,
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
boolean findPort, Configuration conf) throws IOException {
|
boolean findPort, Configuration conf) throws IOException {
|
||||||
this(name, bindAddress, port, findPort, conf, null, null);
|
this(name, bindAddress, port, findPort, conf, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HttpServer(String name, String bindAddress, int port,
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
boolean findPort, Configuration conf, AccessControlList adminsAcl)
|
boolean findPort, Configuration conf, AccessControlList adminsAcl)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this(name, bindAddress, port, findPort, conf, adminsAcl, null);
|
this(name, bindAddress, port, findPort, conf, adminsAcl, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a status server on the given port.
|
* Create a status server on the given port.
|
||||||
* The jsp scripts are taken from src/webapps/<name>.
|
* The jsp scripts are taken from src/webapps/<name>.
|
||||||
* @param name The name of the server
|
* @param name The name of the server
|
||||||
|
* @param bindAddress The address for this server
|
||||||
* @param port The port to use on the server
|
* @param port The port to use on the server
|
||||||
* @param findPort whether the server should start at the given port and
|
* @param findPort whether the server should start at the given port and
|
||||||
* increment by 1 until it finds a free port.
|
* increment by 1 until it finds a free port.
|
||||||
|
@ -181,6 +178,26 @@ public class HttpServer implements FilterContainer {
|
||||||
public HttpServer(String name, String bindAddress, int port,
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
boolean findPort, Configuration conf, AccessControlList adminsAcl,
|
boolean findPort, Configuration conf, AccessControlList adminsAcl,
|
||||||
Connector connector) throws IOException {
|
Connector connector) throws IOException {
|
||||||
|
this(name, bindAddress, port, findPort, conf, adminsAcl, connector, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a status server on the given port.
|
||||||
|
* The jsp scripts are taken from src/webapps/<name>.
|
||||||
|
* @param name The name of the server
|
||||||
|
* @param bindAddress The address for this server
|
||||||
|
* @param port The port to use on the server
|
||||||
|
* @param findPort whether the server should start at the given port and
|
||||||
|
* increment by 1 until it finds a free port.
|
||||||
|
* @param conf Configuration
|
||||||
|
* @param adminsAcl {@link AccessControlList} of the admins
|
||||||
|
* @param connector A jetty connection listener
|
||||||
|
* @param pathSpecs Path specifications that this httpserver will be serving.
|
||||||
|
* These will be added to any filters.
|
||||||
|
*/
|
||||||
|
public HttpServer(String name, String bindAddress, int port,
|
||||||
|
boolean findPort, Configuration conf, AccessControlList adminsAcl,
|
||||||
|
Connector connector, String[] pathSpecs) throws IOException {
|
||||||
webServer = new Server();
|
webServer = new Server();
|
||||||
this.findPort = findPort;
|
this.findPort = findPort;
|
||||||
this.adminsAcl = adminsAcl;
|
this.adminsAcl = adminsAcl;
|
||||||
|
@ -229,7 +246,15 @@ public class HttpServer implements FilterContainer {
|
||||||
c.initFilter(this, conf);
|
c.initFilter(this, conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addDefaultServlets();
|
addDefaultServlets();
|
||||||
|
|
||||||
|
if (pathSpecs != null) {
|
||||||
|
for (String path : pathSpecs) {
|
||||||
|
LOG.info("adding path spec: " + path);
|
||||||
|
addFilterPathMapping(path, webAppContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue