1996fanrui commented on a change in pull request #2241:
URL: https://github.com/apache/hadoop/pull/2241#discussion_r476391343



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetUtils.java
##########
@@ -218,6 +211,28 @@ public static InetSocketAddress createSocketAddr(String 
target,
     return createSocketAddrForHost(host, port);
   }
 
+  private static final Map<String, URI> URI_CACHE = new ConcurrentHashMap<>();

Review comment:
       Hi @Hexiaoqiao 
   DFSUtilClient.isLocalAddress also uses Cache for acceleration. It is 
basically similar to the maximum data size of the current patch Cache, that is, 
the number of DNs. The Cache of DFSUtilClient.isLocalAddress does not use the 
evict policy, so the current patch should not worry about taking up too much 
memory.
   Of course, if the evict policy is added, the code will be more robust. 
   If necessary, I can use guava Cache instead of Map. What do you think?
   
   
https://github.com/apache/hadoop/blob/82a750564631eb3077603bed27058006b3d66309/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSUtilClient.java#L634




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to