Skip to content

Commit

Permalink
Enable optimized Netty direct bytebuffer reflection access (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari authored Jun 17, 2024
1 parent c361cbc commit fe3c5a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ fi
JVM_MEM="${HEAP_OPTS} -XX:+UseG1GC"
JVM_GC_LOG=" -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=64m -Xloggc:/dev/shm/benchmark-client-gc_%p.log"

java -server -cp $CLASSPATH $JVM_MEM io.openmessaging.benchmark.Benchmark $*
java -server -cp $CLASSPATH $JVM_MEM io.openmessaging.benchmark.Benchmark "$@"
11 changes: 9 additions & 2 deletions bin/benchmark-worker
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,12 @@ fi

JVM_MEM="${HEAP_OPTS} -XX:+UseG1GC"
JVM_GC_LOG=" -XX:+PrintGCDetails -XX:+PrintGCApplicationStoppedTime -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=64m -Xloggc:/dev/shm/benchmark-client-gc_%p.log"

exec java -server -cp $CLASSPATH $JVM_MEM io.openmessaging.benchmark.worker.BenchmarkWorker $*
# Required by Netty for optimized direct byte buffer access
JVM_OPTS="$JVM_OPTS -Dio.netty.tryReflectionSetAccessible=true"
JVM_OPTS="$JVM_OPTS --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
# Set io.netty.tryReflectionSetAccessible in Pulsar's shaded client
JVM_OPTS="$JVM_OPTS -Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true"
# Required by Pulsar client optimized checksum calculation on other than Linux x86_64 platforms
# reflection access to java.util.zip.CRC32C
JVM_OPTS="$JVM_OPTS --add-opens java.base/java.util.zip=ALL-UNNAMED"
exec java -server -cp $CLASSPATH $JVM_MEM $JVM_OPTS io.openmessaging.benchmark.worker.BenchmarkWorker "$@"
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,13 @@
<version>${maven.surefire.plugin.version}</version>
<configuration>
<!-- Required by system-lambda test dependency -->
<argLine>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
<!-- Required by Netty for optimized direct byte buffer access -->
<!-- Required by Pulsar client for optimized direct byte buffer access and optimized checksum calculation -->
<argLine>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
-Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true
--add-opens java.base/java.util.zip=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit fe3c5a0

Please sign in to comment.