From 0e6315221879c1a3e07f3c9d10f0445f6574affa Mon Sep 17 00:00:00 2001 From: wangzhaohui <32935220+wzhallright@users.noreply.github.com> Date: Fri, 28 Apr 2023 07:55:01 +0800 Subject: [PATCH] HDFS-16995. Remove unused parameters at NameNodeHttpServer#initWebHdfs (#5601). Contributed by Zhaohui Wang. Signed-off-by: Ayush Saxena --- .../server/federation/router/RouterHttpServer.java | 6 ++---- .../hdfs/server/namenode/NameNodeHttpServer.java | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterHttpServer.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterHttpServer.java index 85044399f98..9f665644aa1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterHttpServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterHttpServer.java @@ -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); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java index e265742978d..911909d8cd0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java @@ -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);