You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ta...@apache.org on 2021/11/17 13:17:45 UTC
[hadoop] branch trunk updated: HDFS-16323. DatanodeHttpServer doesn't require handler state map while retrieving filter handlers (#3659)
This is an automated email from the ASF dual-hosted git repository.
tasanuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 646c470 HDFS-16323. DatanodeHttpServer doesn't require handler state map while retrieving filter handlers (#3659)
646c470 is described below
commit 646c470e5de956e570a81dcd4890f028965be33a
Author: Viraj Jasani <vj...@apache.org>
AuthorDate: Wed Nov 17 18:47:09 2021 +0530
HDFS-16323. DatanodeHttpServer doesn't require handler state map while retrieving filter handlers (#3659)
---
.../hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java
index e4a0c20..46656c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java
@@ -64,7 +64,6 @@ import java.nio.channels.ServerSocketChannel;
import java.security.GeneralSecurityException;
import java.util.Enumeration;
import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_ADMIN;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTPS_ADDRESS_DEFAULT;
@@ -77,8 +76,6 @@ import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTP_INTERNAL_PR
*/
public class DatanodeHttpServer implements Closeable {
static final Logger LOG = LoggerFactory.getLogger(DatanodeHttpServer.class);
- private static final ConcurrentHashMap<Class<?>, Object> HANDLER_STATE
- = new ConcurrentHashMap<Class<?>, Object>() {};
// HttpServer threads are only used for the web UI and basic servlets, so
// set them to the minimum possible
private static final int HTTP_SELECTOR_THREADS = 1;
@@ -281,11 +278,10 @@ public class DatanodeHttpServer implements Closeable {
try {
Method initializeState = classes[i].getDeclaredMethod("initializeState",
Configuration.class);
- Constructor constructor =
+ Constructor<?> constructor =
classes[i].getDeclaredConstructor(initializeState.getReturnType());
handlers[i] = (ChannelHandler) constructor.newInstance(
- HANDLER_STATE.getOrDefault(classes[i],
- initializeState.invoke(null, configuration)));
+ initializeState.invoke(null, configuration));
} catch (NoSuchMethodException | InvocationTargetException
| IllegalAccessException | InstantiationException
| IllegalArgumentException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org