adoroszlai commented on code in PR #5909:
URL: https://github.com/apache/ozone/pull/5909#discussion_r1448731418
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/token/OzoneBlockTokenIdentifier.java:
##########
@@ -170,6 +181,21 @@ public void write(DataOutput out) throws IOException {
out.write(builder.build().toByteArray());
}
+ @Override
+ public byte[] getBytes() {
+ BlockTokenSecretProto.Builder builder = BlockTokenSecretProto.newBuilder()
+ .setBlockId(blockId)
+ .setOwnerId(getOwnerId())
+ .setSecretKeyId(ProtobufUtils.toProtobuf(getSecretKeyId()))
+ .setExpiryDate(getExpiryDate())
+ .setMaxLength(maxLength);
+ // Add access mode allowed
+ for (AccessModeProto mode : modes) {
+ builder.addModes(AccessModeProto.valueOf(mode.name()));
+ }
+ return builder.build().toByteArray();
+ }
Review Comment:
`getBytes()` is overridden (optimized) only for block token. Did you intend
to do the same for container token?
--
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]