kerneltime commented on a change in pull request #3032:
URL: https://github.com/apache/ozone/pull/3032#discussion_r797869200
##########
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);
+ CacheValue<OmKeyInfo> omKeyInfoCacheValue =
+ keyTable.getCacheValue(new CacheKey(k));
+ if(!inCache || omKeyInfoCacheValue != null) {
Review comment:
Thank you. I found it easier to add a new explicit API but will revert
this part of the code and just use the null checks. :-)
--
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]