jojochuang commented on code in PR #3709:
URL: https://github.com/apache/ozone/pull/3709#discussion_r954103300
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/Checksum.java:
##########
@@ -60,7 +61,7 @@ private static Function<ByteBuffer, ByteString>
newMessageDigestFunction(
}
public static ByteString int2ByteString(int n) {
- return ByteString.copyFrom(Ints.toByteArray(n));
+ return UnsafeByteOperations.unsafeWrap(Ints.toByteArray(n));
Review Comment:
Yeah..i thought about that but
(1) it seems quite involved to pass the configuration object over to make
the decision
(2) while it's called "unsafe byte operations", because the byte array
passed in is guaranteed immutable (Ints.toByteArray(n) returns a new temporary
byte array), it is safe.
--
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]