HDFS-16995. Remove unused parameters at NameNodeHttpServer#initWebHdfs (#5601). Contributed by Zhaohui Wang.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
wangzhaohui 2023-04-28 07:55:01 +08:00 committed by GitHub
parent d9576bb9ee
commit 0e63152218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -88,10 +88,8 @@ public class RouterHttpServer extends AbstractService {
this.httpServer = builder.build();
String httpKeytab = conf.get(DFSUtil.getSpnegoKeytabKey(conf,
RBFConfigKeys.DFS_ROUTER_KEYTAB_FILE_KEY));
NameNodeHttpServer.initWebHdfs(conf, httpAddress.getHostName(), httpKeytab,
httpServer, RouterWebHdfsMethods.class.getPackage().getName());
NameNodeHttpServer.initWebHdfs(conf, httpServer,
RouterWebHdfsMethods.class.getPackage().getName());
this.httpServer.setAttribute(NAMENODE_ATTRIBUTE_KEY, this.router);
this.httpServer.setAttribute(JspHelper.CURRENT_CONF, this.conf);

View File

@ -76,10 +76,8 @@ public class NameNodeHttpServer {
this.bindAddress = bindAddress;
}
public static void initWebHdfs(Configuration conf, String hostname,
String httpKeytab,
HttpServer2 httpServer2, String jerseyResourcePackage)
throws IOException {
public static void initWebHdfs(Configuration conf, HttpServer2 httpServer2,
String jerseyResourcePackage) throws IOException {
// set user pattern based on configuration file
UserParam.setUserPattern(conf.get(
HdfsClientConfigKeys.DFS_WEBHDFS_USER_PATTERN_KEY,
@ -159,10 +157,8 @@ public class NameNodeHttpServer {
httpServer.setAttribute(DFSConfigKeys.DFS_DATANODE_HTTPS_PORT_KEY,
datanodeSslPort.getPort());
}
String httpKeytab = conf.get(DFSUtil.getSpnegoKeytabKey(conf,
DFSConfigKeys.DFS_NAMENODE_KEYTAB_FILE_KEY));
initWebHdfs(conf, bindAddress.getHostName(), httpKeytab, httpServer,
NamenodeWebHdfsMethods.class.getPackage().getName());
initWebHdfs(conf, httpServer, NamenodeWebHdfsMethods.class.getPackage().getName());
httpServer.setAttribute(NAMENODE_ATTRIBUTE_KEY, nn);
httpServer.setAttribute(JspHelper.CURRENT_CONF, conf);