Skip to content

Commit 646c470

Browse files
authored
HDFS-16323. DatanodeHttpServer doesn't require handler state map while retrieving filter handlers (#3659)
1 parent 54a1d78 commit 646c470

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/DatanodeHttpServer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import java.security.GeneralSecurityException;
6565
import java.util.Enumeration;
6666
import java.util.Map;
67-
import java.util.concurrent.ConcurrentHashMap;
6867

6968
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_ADMIN;
7069
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTPS_ADDRESS_DEFAULT;
@@ -77,8 +76,6 @@
7776
*/
7877
public class DatanodeHttpServer implements Closeable {
7978
static final Logger LOG = LoggerFactory.getLogger(DatanodeHttpServer.class);
80-
private static final ConcurrentHashMap<Class<?>, Object> HANDLER_STATE
81-
= new ConcurrentHashMap<Class<?>, Object>() {};
8279
// HttpServer threads are only used for the web UI and basic servlets, so
8380
// set them to the minimum possible
8481
private static final int HTTP_SELECTOR_THREADS = 1;
@@ -281,11 +278,10 @@ private ChannelHandler[] getFilterHandlers(Configuration configuration) {
281278
try {
282279
Method initializeState = classes[i].getDeclaredMethod("initializeState",
283280
Configuration.class);
284-
Constructor constructor =
281+
Constructor<?> constructor =
285282
classes[i].getDeclaredConstructor(initializeState.getReturnType());
286283
handlers[i] = (ChannelHandler) constructor.newInstance(
287-
HANDLER_STATE.getOrDefault(classes[i],
288-
initializeState.invoke(null, configuration)));
284+
initializeState.invoke(null, configuration));
289285
} catch (NoSuchMethodException | InvocationTargetException
290286
| IllegalAccessException | InstantiationException
291287
| IllegalArgumentException e) {

0 commit comments

Comments
 (0)