amaliujia commented on code in PR #10062:
URL: https://github.com/apache/ozone/pull/10062#discussion_r3386871772
##########
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:
:-) for only 0 or 1 we can go for one bit.
--
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]