sodonnel commented on a change in pull request #3032:
URL: https://github.com/apache/ozone/pull/3032#discussion_r797449180



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
##########
@@ -934,9 +929,17 @@ public boolean isBucketEmpty(String volume, String bucket)
 
           // Entry should not be marked for delete, consider only those
           // entries.
-          if(!deletedKeySet.contains(kv.getKey())) {
-            cacheKeyMap.put(kv.getKey(), kv.getValue());
-            currentCount++;
+          String key = kv.getKey();
+          try {
+            CacheKey<String> k = new CacheKey<>(key);
+            boolean inCache = keyTable.isKeyInCache(k);

Review comment:
       Do we need the `isKeyInCache()` call here, as it means we are going into 
the cache twice? Can we not just do:
   
   ```
   CacheValue cv = keyTable.getCacheValue()
   if (cv == null) {
       // The key is not in the cache at all
   } else {
       // The key is in the cache, but the value may be null.
       // We need to call cv.getCacheValue() to get the actual value
       // which will be null for a deleted key.
   }




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