Skip to content

Commit a50cd99

Browse files
committed
Add instructions about Java9IntHash
1 parent f54c4fc commit a50cd99

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

docs/client-libraries-java-setup.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,12 @@ To enable this feature in Java clients since Java 11, you need to add the follow
184184
In addition, you need to add one of the following JVM options:
185185

186186
- `-Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true` for the default shaded Pulsar client
187-
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
187+
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
188+
189+
### Enabling optimized checksum calculation when native library loading fails
190+
191+
The Pulsar Java client uses `com.scurrilous.circe.checksum.Crc32cIntChecksum` class from the BookKeeper client for checksum calculation. For optimized checksum calculation Pulsar attempts to load `libcirce-checksum` native library. When that isn't available, `com.scurrilous.circe.checksum.Java9IntHash` class is used.
192+
This only works when `--add-opens java.base/java.util.zip=ALL-UNNAMED` is passed in the JVM options.
193+
The error message will be `Unable to use reflected methods:
194+
java.lang.reflect.InaccessibleObjectException: Unable to make private static int java.util.zip.CRC32C.updateBytes(int,byte[],int,int) accessible: module java.base does not "opens java.util.zip" to unnamed module` when the required JVM option is missing
195+

versioned_docs/version-3.0.x/client-libraries-java-setup.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,12 @@ To enable this feature in Java clients since Java 11, you need to add the follow
8888
In addition, you need to add one of the following JVM options:
8989

9090
- `-Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true` for the default shaded Pulsar client
91-
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
91+
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
92+
93+
### Enabling optimized checksum calculation when native library loading fails
94+
95+
The Pulsar Java client uses `com.scurrilous.circe.checksum.Crc32cIntChecksum` class from the BookKeeper client for checksum calculation. For optimized checksum calculation Pulsar attempts to load `libcirce-checksum` native library. When that isn't available, `com.scurrilous.circe.checksum.Java9IntHash` class is used.
96+
This only works when `--add-opens java.base/java.util.zip=ALL-UNNAMED` is passed in the JVM options.
97+
The error message will be `Unable to use reflected methods:
98+
java.lang.reflect.InaccessibleObjectException: Unable to make private static int java.util.zip.CRC32C.updateBytes(int,byte[],int,int) accessible: module java.base does not "opens java.util.zip" to unnamed module` when the required JVM option is missing
99+

versioned_docs/version-4.0.x/client-libraries-java-setup.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,12 @@ To enable this feature in Java clients since Java 11, you need to add the follow
184184
In addition, you need to add one of the following JVM options:
185185

186186
- `-Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true` for the default shaded Pulsar client
187-
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
187+
- `-Dio.netty.tryReflectionSetAccessible=true` for the unshaded "original" Pulsar client
188+
189+
### Enabling optimized checksum calculation when native library loading fails
190+
191+
The Pulsar Java client uses `com.scurrilous.circe.checksum.Crc32cIntChecksum` class from the BookKeeper client for checksum calculation. For optimized checksum calculation Pulsar attempts to load `libcirce-checksum` native library. When that isn't available, `com.scurrilous.circe.checksum.Java9IntHash` class is used.
192+
This only works when `--add-opens java.base/java.util.zip=ALL-UNNAMED` is passed in the JVM options.
193+
The error message will be `Unable to use reflected methods:
194+
java.lang.reflect.InaccessibleObjectException: Unable to make private static int java.util.zip.CRC32C.updateBytes(int,byte[],int,int) accessible: module java.base does not "opens java.util.zip" to unnamed module` when the required JVM option is missing
195+

0 commit comments

Comments
 (0)