You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/02 10:10:22 UTC

[GitHub] [ozone] sodonnel commented on a change in pull request #3032: HDDS-6238 Reduce memory requirements for list keys.

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org