File tree Expand file tree Collapse file tree 9 files changed +44
-3
lines changed Expand file tree Collapse file tree 9 files changed +44
-3
lines changed Original file line number Diff line number Diff line change @@ -197,11 +197,18 @@ OPTS="$OPTS --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java
197
197
# https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
198
198
# https://github.com/netty/netty/issues/12265
199
199
OPTS=" $OPTS --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
200
+ # Required by RocksDB java.lang.System::loadLibrary call
201
+ OPTS=" $OPTS --enable-native-access=ALL-UNNAMED"
200
202
201
203
OPTS=" -cp $BOOKIE_CLASSPATH $OPTS "
202
204
203
205
# Disable ipv6 as it can cause issues
204
206
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS "
207
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
208
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
209
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
210
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
211
+ fi
205
212
206
213
OPTS=" $OPTS $BOOKIE_MEM $BOOKIE_GC $BOOKIE_GC_LOG $BOOKIE_EXTRA_OPTS "
207
214
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ PULSAR_MEM=${PULSAR_MEM:-"-Xmx128m -XX:MaxDirectMemorySize=128m"}
54
54
# Garbage collection options
55
55
if [ -z " $PULSAR_GC " ]; then
56
56
PULSAR_GC=" -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch"
57
- if [[ $JAVA_MAJOR_VERSION -ge 21 ]]; then
57
+ if [[ $JAVA_MAJOR_VERSION -eq 21 || $JAVA_MAJOR_VERSION -eq 22 ]]; then
58
58
PULSAR_GC=" -XX:+UseZGC -XX:+ZGenerational ${PULSAR_GC} "
59
59
else
60
60
PULSAR_GC=" -XX:+UseZGC ${PULSAR_GC} "
132
132
# rarely needed when trying to list many z-nodes under a
133
133
# directory)
134
134
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS -Djute.maxbuffer=10485760"
135
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
136
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
137
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
138
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
139
+ fi
135
140
136
141
OPTS=" -cp $PULSAR_CLASSPATH $OPTS "
137
142
Original file line number Diff line number Diff line change @@ -274,6 +274,12 @@ OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF`"
274
274
# rarely needed when trying to list many z-nodes under a
275
275
# directory)
276
276
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS -Djute.maxbuffer=10485760"
277
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
278
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
279
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
280
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
281
+ fi
282
+
277
283
# Enable TCP keepalive for all Zookeeper client connections
278
284
OPTS=" $OPTS -Dzookeeper.clientTcpKeepAlive=true"
279
285
@@ -292,6 +298,8 @@ OPTS="$OPTS -Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true"
292
298
OPTS=" $OPTS --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
293
299
# Required by LinuxInfoUtils
294
300
OPTS=" $OPTS --add-opens java.base/jdk.internal.platform=ALL-UNNAMED"
301
+ # Required by RocksDB java.lang.System::loadLibrary call
302
+ OPTS=" $OPTS --enable-native-access=ALL-UNNAMED"
295
303
296
304
OPTS=" -cp $PULSAR_CLASSPATH $OPTS "
297
305
Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ REM Allow Netty to use reflection access
66
66
set " OPTS = %OPTS% -Dio.netty.tryReflectionSetAccessible=true"
67
67
set " OPTS = %OPTS% -Dorg.apache.pulsar.shade.io.netty.tryReflectionSetAccessible=true"
68
68
69
+ if %JAVA_MAJOR_VERSION% GTR 23 (
70
+ REM Required to allow sun.misc.Unsafe on JDK 24 without warnings
71
+ REM Also required for enabling unsafe memory access for Netty since 4.1.121.Final
72
+ set " OPTS = --sun-misc-unsafe-memory-access=allow %OPTS% "
73
+ )
74
+
69
75
if %JAVA_MAJOR_VERSION% GTR 8 (
70
76
set " OPTS = %OPTS% --add-opens java.base/sun.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
71
77
REM Required by Pulsar client optimized checksum calculation on other than Linux x86_64 platforms
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH"
105
105
PULSAR_CLASSPATH=" ` dirname $PULSAR_LOG_CONF ` :$PULSAR_CLASSPATH "
106
106
OPTS=" $OPTS -Dlog4j.configurationFile=` basename $PULSAR_LOG_CONF ` "
107
107
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS "
108
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
109
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
110
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
111
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
112
+ fi
108
113
109
114
# Allow Netty to use reflection access
110
115
OPTS=" $OPTS -Dio.netty.tryReflectionSetAccessible=true"
Original file line number Diff line number Diff line change 102
102
PULSAR_CLASSPATH=" $PULSAR_JAR :$PULSAR_CLASSPATH :$PULSAR_EXTRA_CLASSPATH "
103
103
PULSAR_CLASSPATH=" ` dirname $PULSAR_LOG_CONF ` :$PULSAR_CLASSPATH "
104
104
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS -Dlog4j.configurationFile=` basename $PULSAR_LOG_CONF ` "
105
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
106
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
107
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
108
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
109
+ fi
105
110
106
111
# Allow Netty to use reflection access
107
112
OPTS=" $OPTS -Dio.netty.tryReflectionSetAccessible=true"
Original file line number Diff line number Diff line change 61
61
BOOKIE_GC=" ${BOOKIE_GC:- ${PULSAR_GC} } "
62
62
if [ -z " $BOOKIE_GC " ]; then
63
63
BOOKIE_GC=" -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch"
64
- if [[ $JAVA_MAJOR_VERSION -ge 21 ]]; then
64
+ if [[ $JAVA_MAJOR_VERSION -eq 21 || $JAVA_MAJOR_VERSION -eq 22 ]]; then
65
65
BOOKIE_GC=" -XX:+UseZGC -XX:+ZGenerational ${BOOKIE_GC} "
66
66
else
67
67
BOOKIE_GC=" -XX:+UseZGC ${BOOKIE_GC} "
Original file line number Diff line number Diff line change 67
67
# Garbage collection options
68
68
if [ -z " $PULSAR_GC " ]; then
69
69
PULSAR_GC=" -XX:+PerfDisableSharedMem -XX:+AlwaysPreTouch"
70
- if [[ $JAVA_MAJOR_VERSION -ge 21 ]]; then
70
+ if [[ $JAVA_MAJOR_VERSION -eq 21 || $JAVA_MAJOR_VERSION -eq 22 ]]; then
71
71
PULSAR_GC=" -XX:+UseZGC -XX:+ZGenerational ${PULSAR_GC} "
72
72
else
73
73
PULSAR_GC=" -XX:+UseZGC ${PULSAR_GC} "
Original file line number Diff line number Diff line change 109
109
PULSAR_CLASSPATH=" $PULSAR_JAR :$PULSAR_HOME /pulsar-io/docs/target/pulsar-io-docs.jar:$PULSAR_CLASSPATH :$PULSAR_EXTRA_CLASSPATH "
110
110
PULSAR_CLASSPATH=" ` dirname $PULSAR_LOG_CONF ` :$PULSAR_CLASSPATH "
111
111
OPTS=" -Djava.net.preferIPv4Stack=true $OPTS -Dlog4j.configurationFile=` basename $PULSAR_LOG_CONF ` "
112
+ # Required to allow sun.misc.Unsafe on JDK 24 without warnings
113
+ # Also required for enabling unsafe memory access for Netty since 4.1.121.Final
114
+ if [[ $JAVA_MAJOR_VERSION -ge 23 ]]; then
115
+ OPTS=" --sun-misc-unsafe-memory-access=allow $OPTS "
116
+ fi
112
117
113
118
OPTS=" -cp $PULSAR_CLASSPATH $OPTS "
114
119
OPTS=" $OPTS $PULSAR_EXTRA_OPTS "
You can’t perform that action at this time.
0 commit comments