Review Board 1.7.22


Allow both ACL list and global path spec filters to HttpServer

Review Request #2549 - Created Oct. 24, 2011 and submitted

Jonathan Eagles
HADOOP-7764
Reviewers
mholderba, raviprak, revans2
hadoop-common-git
HttpServer allows setting global path spec filters in one constructor and ACL list in another constructor. Having both set in HttpServer is not user settable either by public API or constructor.

This feature is needed for MAPREDUCE-3175. No tests were added since no new functionality was added. Only a single API change.

 

Diff revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

1 2
1 2

  1. hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java: Loading...
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java
Revision 6ad3703 New Change
[20] 135 lines
[+20] [+] public class HttpServer implements FilterContainer {
136
   * @param findPort whether the server should start at the given port and 
136
   * @param findPort whether the server should start at the given port and 
137
   *        increment by 1 until it finds a free port.
137
   *        increment by 1 until it finds a free port.
138
   * @param conf Configuration 
138
   * @param conf Configuration 
139
   * @param pathSpecs Path specifications that this httpserver will be serving. 
139
   * @param pathSpecs Path specifications that this httpserver will be serving. 
140
   *        These will be added to any filters.
140
   *        These will be added to any filters.

    
   
141
   * @param adminsAcl {@link AccessControlList} of the admins

    
   
142
   */

    
   
143
  public HttpServer(String name, String bindAddress, int port,

    
   
144
      boolean findPort, Configuration conf, AccessControlList adminsAcl, 

    
   
145
      Connector connector, String[] pathSpecs) throws IOException {

    
   
146
    this(name, bindAddress, port, findPort, conf, adminsAcl, connector);

    
   
147
    for (String path : pathSpecs) {

    
   
148
        LOG.info("adding path spec: " + path);

    
   
149
      addFilterPathMapping(path, webAppContext);

    
   
150
    }

    
   
151
  }

    
   
152
  

    
   
153
  /**

    
   
154
   * Create a status server on the given port. Allows you to specify the

    
   
155
   * path specifications that this server will be serving so that they will be

    
   
156
   * added to the filters properly.  

    
   
157
   * 

    
   
158
   * @param name The name of the server

    
   
159
   * @param bindAddress The address for this server

    
   
160
   * @param port The port to use on the server

    
   
161
   * @param findPort whether the server should start at the given port and 

    
   
162
   *        increment by 1 until it finds a free port.

    
   
163
   * @param conf Configuration 

    
   
164
   * @param pathSpecs Path specifications that this httpserver will be serving. 

    
   
165
   *        These will be added to any filters.
141
   */
166
   */
142
  public HttpServer(String name, String bindAddress, int port,
167
  public HttpServer(String name, String bindAddress, int port,
143
      boolean findPort, Configuration conf, String[] pathSpecs) throws IOException {
168
      boolean findPort, Configuration conf, String[] pathSpecs) throws IOException {
144
    this(name, bindAddress, port, findPort, conf, null, null);
169
    this(name, bindAddress, port, findPort, conf, null, null);
145
    for (String path : pathSpecs) {
170
    for (String path : pathSpecs) {
[+20] [20] 786 lines
  1. hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer.java: Loading...