spacemonkd commented on code in PR #10062:
URL: https://github.com/apache/ozone/pull/10062#discussion_r3378211571
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java:
##########
@@ -507,12 +514,21 @@ public MultipartKeyInfo getProto() {
}
builder.addAllAcls(OzoneAclUtil.toProtobuf(acls));
- if (schemaVersion == 0) {
+ if (schemaVersion == LEGACY_SCHEMA_VERSION) {
builder.addAllPartKeyInfoList(partKeyInfoMap);
}
return builder.build();
}
+ private static byte validateAndConvertSchemaVersion(int schemaVersion) {
+ if (schemaVersion != LEGACY_SCHEMA_VERSION
+ && schemaVersion != SPLIT_PARTS_SCHEMA_VERSION) {
+ throw new IllegalArgumentException("Unsupported schemaVersion: "
+ + schemaVersion + ". Expected one of [0, 1].");
+ }
+ return (byte) schemaVersion;
Review Comment:
Yes, I have reverted to `int`.
Initially I kept as `byte` since we only support the values as 0 or 1 so we
do not need to allocate memory for an integer, but I guess it is easier to read
with it being int.
--
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]