kaijchen commented on code in PR #4287:
URL: https://github.com/apache/ozone/pull/4287#discussion_r1111675074


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -1176,24 +1176,51 @@ private OzoneFileStatus getOzoneFileStatus(OmKeyArgs 
args,
    */
   private OmKeyInfo createFakeDirIfShould(String volume, String bucket,
       String keyName, BucketLayout layout) throws IOException {
-    OmKeyInfo fakeDirKeyInfo = null;
     String dirKey = OzoneFSUtils.addTrailingSlashIfNeeded(keyName);
     String targetKey = OzoneFSUtils.addTrailingSlashIfNeeded(
         metadataManager.getOzoneKey(volume, bucket, keyName));
+
+    Table<String, OmKeyInfo> keyTable = metadataManager.getKeyTable(layout);
+    Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> cacheIterator 
=
+        keyTable.cacheIterator();
+    while (cacheIterator.hasNext()) {

Review Comment:
   KeyTableCache is `PartialTableCache`, which is implemented by 
`ConcurrentHashMap`. Will there be a problem If the iterator visits the entries 
out of order?
   I think it's fine since the exact cache hit should be filtered in 
https://github.com/apache/ozone/pull/4287#issuecomment-1436492008
   
   



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

To unsubscribe, e-mail: [email protected]

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