smengcl commented on a change in pull request #584: HDDS-3054. 
OzoneFileStatus#getModificationTime should return actual directory modification 
time when its OmKeyInfo is available
URL: https://github.com/apache/hadoop-ozone/pull/584#discussion_r384707298
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
 ##########
 @@ -2005,15 +2016,21 @@ public OmKeyInfo lookupFile(OmKeyArgs args, String 
clientAddress)
               if (isFile) {
                 if (!deletedKeySet.contains(entryInDb)) {
                   cacheKeyMap.put(entryInDb,
-                      new OzoneFileStatus(value, scmBlockSize, !isFile));
+                      new OzoneFileStatus(omKeyInfo, scmBlockSize, !isFile));
                   countEntries++;
                 }
                 iterator.next();
               } else {
                 // if entry is a directory
                 if (!deletedKeySet.contains(entryInDb)) {
-                  cacheKeyMap.put(entryInDb,
-                      new OzoneFileStatus(immediateChild));
+                  if (!entryKeyName.equals(immediateChild)) {
+                    cacheKeyMap.put(entryInDb,
+                        new OzoneFileStatus(immediateChild));
+                  } else {
+                    // If entryKeyName matches dir name, we have the info
+                    cacheKeyMap.put(entryInDb,
+                        new OzoneFileStatus(omKeyInfo, 0, true));
 
 Review comment:
   > Could you please explain this change.
   
   Checkstyle complains the listStatus exceeded 150 LOC and I have to make 
space for my change

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