ijuma commented on code in PR #12163:
URL: https://github.com/apache/kafka/pull/12163#discussion_r900170120
##########
clients/src/main/java/org/apache/kafka/common/utils/Checksums.java:
##########
@@ -30,21 +36,74 @@
*/
public final class Checksums {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(Checksums.class);
+ private static final MethodHandle BYTE_BUFFER_UPDATE;
+
+ static {
+ MethodHandle byteBufferUpdate = null;
+ if (Java.IS_JAVA9_COMPATIBLE) {
+ try {
+ byteBufferUpdate =
MethodHandles.publicLookup().findVirtual(Checksum.class, "update",
MethodType.methodType(void.class, ByteBuffer.class));
+ } catch (Throwable t) {
+ LOGGER.warn("Cannot uses
java.util.zip.Checksum::update(ByteBuffer): direct ByteBuffers checksum won't
use optimized platform support", t);
Review Comment:
Thanks. I am still not clear why we'd rather warn than fail. With the
current code, if there's a bug in this logic, our tests won't catch it (we'll
simply have a logged warning).
--
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]