captainzmc commented on a change in pull request #3206:
URL: https://github.com/apache/ozone/pull/3206#discussion_r830592058



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
##########
@@ -585,11 +586,15 @@ protected static long sumBlockLengths(OmKeyInfo 
omKeyInfo) {
   /**
    * Return bucket info for the specified bucket.
    */
+  @Nullable
   protected OmBucketInfo getBucketInfo(OMMetadataManager omMetadataManager,
       String volume, String bucket) {
-    return omMetadataManager.getBucketTable().getCacheValue(
-        new CacheKey<>(omMetadataManager.getBucketKey(volume, bucket)))
-        .getCacheValue();
+    String bucketKey = omMetadataManager.getBucketKey(volume, bucket);
+
+    CacheValue<OmBucketInfo> value = omMetadataManager.getBucketTable()
+        .getCacheValue(new CacheKey<>(bucketKey));
+
+    return value != null ? value.getCacheValue() : null;

Review comment:
       When is OmBucketInfo null? Does our code currently handle the 
OmBucketInfo null case?




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