Skip to content

Commit dc0dab9

Browse files
committed
add Spark JVM --add-opens for Nexmark
1 parent de21b1c commit dc0dab9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sdks/java/testing/nexmark/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ if (isSparkRunner) {
114114
}
115115
}
116116

117+
def sparkJvmArgs() {
118+
def testJavaVer = project.findProperty('testJavaVersion') ? (project.property('testJavaVersion') as int) : JavaVersion.current().majorVersion.toInteger()
119+
if (testJavaVer >= 17) {
120+
return [
121+
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
122+
"--add-opens=java.base/java.nio=ALL-UNNAMED",
123+
"--add-opens=java.base/java.util=ALL-UNNAMED",
124+
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
125+
]
126+
}
127+
return []
128+
}
129+
117130
def getNexmarkArgs = {
118131
def nexmarkArgsStr = project.findProperty(nexmarkArgsProperty) ?: ""
119132
def nexmarkArgsList = new ArrayList<String>()
@@ -179,6 +192,7 @@ task run(type: JavaExec) {
179192
systemProperty "spark.ui.showConsoleProgress", "false"
180193
// Dataset runner only
181194
systemProperty "spark.sql.shuffle.partitions", "4"
195+
jvmArgs += sparkJvmArgs()
182196
}
183197

184198
mainClass = "org.apache.beam.sdk.nexmark.Main"

0 commit comments

Comments
 (0)