jojochuang commented on a change in pull request #1725: HDFS-13616. Batch 
listing of multiple directories
URL: https://github.com/apache/hadoop/pull/1725#discussion_r348842194
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 ##########
 @@ -3923,6 +3944,148 @@ DirectoryListing getListing(String src, byte[] 
startAfter,
     return dl;
   }
 
+  public byte[] getSrcPathsHash(String[] srcs) {
+    MessageDigest md;
+    try {
+      md = MessageDigest.getInstance("MD5");
 
 Review comment:
   We should refine this method.
   
   1. synchronize this method.
   2. MessageDigest.getInstance() has big overhead so we should reuse it. (It's 
instantiates a new object each time)
   3. After use, call MessageDigest#reset(). 
   
   https://stackoverflow.com/questions/13802627/when-to-use-messagedigest-reset

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to