|
64 | 64 | import java.security.GeneralSecurityException; |
65 | 65 | import java.util.Enumeration; |
66 | 66 | import java.util.Map; |
67 | | -import java.util.concurrent.ConcurrentHashMap; |
68 | 67 |
|
69 | 68 | import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_ADMIN; |
70 | 69 | import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTPS_ADDRESS_DEFAULT; |
|
77 | 76 | */ |
78 | 77 | public class DatanodeHttpServer implements Closeable { |
79 | 78 | static final Logger LOG = LoggerFactory.getLogger(DatanodeHttpServer.class); |
80 | | - private static final ConcurrentHashMap<Class<?>, Object> HANDLER_STATE |
81 | | - = new ConcurrentHashMap<Class<?>, Object>() {}; |
82 | 79 | // HttpServer threads are only used for the web UI and basic servlets, so |
83 | 80 | // set them to the minimum possible |
84 | 81 | private static final int HTTP_SELECTOR_THREADS = 1; |
@@ -281,11 +278,10 @@ private ChannelHandler[] getFilterHandlers(Configuration configuration) { |
281 | 278 | try { |
282 | 279 | Method initializeState = classes[i].getDeclaredMethod("initializeState", |
283 | 280 | Configuration.class); |
284 | | - Constructor constructor = |
| 281 | + Constructor<?> constructor = |
285 | 282 | classes[i].getDeclaredConstructor(initializeState.getReturnType()); |
286 | 283 | handlers[i] = (ChannelHandler) constructor.newInstance( |
287 | | - HANDLER_STATE.getOrDefault(classes[i], |
288 | | - initializeState.invoke(null, configuration))); |
| 284 | + initializeState.invoke(null, configuration)); |
289 | 285 | } catch (NoSuchMethodException | InvocationTargetException |
290 | 286 | | IllegalAccessException | InstantiationException |
291 | 287 | | IllegalArgumentException e) { |
|
0 commit comments