kerneltime commented on code in PR #6162:
URL: https://github.com/apache/ozone/pull/6162#discussion_r1484833804
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChecksumByteBufferImpl.java:
##########
@@ -46,6 +52,18 @@ public class ChecksumByteBufferImpl implements
ChecksumByteBuffer {
LOG.error("No isReadOnly field in ByteBuffer", e);
}
IS_READY_ONLY_FIELD = f;
+
+ MethodHandle byteBufferUpdate = null;
+ if (JavaUtils.isJavaVersionAtLeast(9)) {
+ try {
+ byteBufferUpdate =
MethodHandles.publicLookup().findVirtual(Checksum.class, "update",
Review Comment:
Why not `NativeCheckSumCRC32`? This reflection is to lock the implementation
to be used if the Java version is recent?
Also, not sure if the unit test will fail if I skip using the locked
implementation.
```
─⠠⠵ java -version
openjdk version "1.8.0_392"
OpenJDK Runtime Environment (Zulu 8.74.0.17-CA-macos-aarch64) (build
1.8.0_392-b08)
OpenJDK 64-Bit Server VM (Zulu 8.74.0.17-CA-macos-aarch64) (build
25.392-b08, mixed mode)
```
--
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]