ayushtkn commented on a change in pull request #3077:
URL: https://github.com/apache/ozone/pull/3077#discussion_r805569401
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -149,7 +149,9 @@ public OMClientResponse validateAndUpdateCache(OzoneManager
ozoneManager,
} else {
omBucketInfo = OmBucketInfo.getFromProtobuf(bucketInfo);
}
-
+ if (omBucketInfo.getBucketLayout().isFileSystemOptimized()) {
+ omMetrics.incNumFSOBucketCreates();
+ }
Review comment:
Hey Rakesh,
Got little confused, you mean to say:
```
if (bucketInfo.getBucketLayout() == null || bucketInfo.getBucketLayout()
.equals(BucketLayoutProto.LEGACY)) {
// Bucket Layout argument was not passed during bucket creation.
String omDefaultBucketLayout = ozoneManager.getOMDefaultBucketLayout();
BucketLayout defaultType =
BucketLayout.fromString(omDefaultBucketLayout);
omBucketInfo = OmBucketInfo.getFromProtobuf(bucketInfo, defaultType);
} else {
omBucketInfo = OmBucketInfo.getFromProtobuf(bucketInfo);
}
```
Post this block there won't be any ``null`` check required because
``omBucketInfo`` is being set to some value in this block?
Then in that case value is being set to ``omBucketInfo`` and in the new code
added there is an operation
``omBucketInfo.getBucketLayout().isFileSystemOptimized()``, we didn't modify
``omBucketInfo.getBucketLayout()``? So if that is ``null`` and we call for
``isFileSystemOptimized()`` on top of it, this would throw NPE, right?
Or if you mean to say pull the new code in the else block, yeps that won't
require any null check.
Just had a quick look on it, might have messed up. Please don't hold this
for me. You can proceed if you are convinced with the present code. :-)
--
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]