kerneltime commented on a change in pull request #3053:
URL: https://github.com/apache/ozone/pull/3053#discussion_r801911915



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -1414,9 +1421,9 @@ private void listStatusFindKeyInTableCache(
       }
       OmKeyInfo cacheOmKeyInfo = entry.getValue().getCacheValue();
       // cacheOmKeyInfo is null if an entry is deleted in cache
-      if (cacheOmKeyInfo != null) {
-        if (cacheKey.startsWith(startCacheKey) &&
-            cacheKey.compareTo(startCacheKey) >= 0) {
+      if (cacheKey.startsWith(startCacheKey) &&
+          cacheKey.compareTo(startCacheKey) >= 0) {
+        if (cacheOmKeyInfo != null) {

Review comment:
       Also, it should be cheaper to do prefix checks than look up the cache..




-- 
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-unsubscr...@ozone.apache.org

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



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

Reply via email to