kuenishi commented on a change in pull request #2813:
URL: https://github.com/apache/ozone/pull/2813#discussion_r820311233
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java
##########
@@ -497,12 +536,16 @@ private static String failureMessage(String volume,
String bucket,
volume + " bucket: " + bucket + " key: " + keyName;
}
+ @SuppressWarnings("parameternumber")
private void updateCache(OMMetadataManager omMetadataManager,
+ String dbBucketKey, OmBucketInfo omBucketInfo,
Review comment:
In this method, omBucketInfo can be null to represent the update having
no size change, which is set a few lines ago.
```java
if (usedBytesDiff != 0) {
omBucketInfo.incrUsedBytes(usedBytesDiff);
dbBucketKey = omMetadataManager.getBucketKey(
omBucketInfo.getVolumeName(), omBucketInfo.getBucketName());
} else {
// If no bucket size changed, prevent from updating bucket object
omBucketInfo = null;
}
```
This nullability is also used in `S3MultipartUploadCompleteRequest` to avoid
the change in the batch (avoiding one update in RocksDB).
To make my intention clearer, I added a `@Nullable` annotation and added a
few lines of comment to ensure why it can be null.
--
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]