rakeshadr commented on a change in pull request #2707:
URL: https://github.com/apache/ozone/pull/2707#discussion_r722924739
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -145,12 +143,9 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
OmBucketInfo omBucketInfo = null;
if (bucketInfo.getBucketLayout() == null || bucketInfo.getBucketLayout()
.equals(BucketLayoutProto.LEGACY)) {
Review comment:
Since we use enum in the proto, it will assign the default value
automatically when the bucket layout is not specified or passed. It will use
the first indexed enum value as default, which is LEGACY [Proto
Reference](https://developers.google.com/protocol-buffers/docs/proto3#default)
We have added the null check for the safer side, which is actually not
required.
Supported values are only OBJECT_STORE and FILE_SYSTEM_OPTIMIZED.
Client/User won't pass LEGACY so the LEGACY can occur when the argument is
missing.
I think, [allowed
values](https://github.com/apache/ozone/blob/master/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java#L56)
has to be revisited. @JyotinderSingh can you please check it quickly by
removing LEGACY from `AllowedBucketLayouts`. I think to raise a separate
sub-task to address client side validation for the SUPPORTED_VALUES, if it
requires more code changes.
@bharatviswa504 Does this make sense to you?
```
enum BucketLayoutProto {
LEGACY = 1;
FILE_SYSTEM_OPTIMIZED = 2;
OBJECT_STORE = 3;
}
```
[OmClientProtocol.proto#L556
BucketLayoutProto](https://github.com/apache/ozone/blob/master/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto#L556)
--
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]