File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
hbase-server/src/test/java/org/apache/hadoop/hbase Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 122122import org .apache .hadoop .hbase .util .CommonFSUtils ;
123123import org .apache .hadoop .hbase .util .EnvironmentEdgeManager ;
124124import org .apache .hadoop .hbase .util .FSUtils ;
125+ import org .apache .hadoop .hbase .util .JVM ;
125126import org .apache .hadoop .hbase .util .JVMClusterUtil ;
126127import org .apache .hadoop .hbase .util .JVMClusterUtil .MasterThread ;
127128import org .apache .hadoop .hbase .util .JVMClusterUtil .RegionServerThread ;
@@ -2322,6 +2323,14 @@ private void startMiniMapReduceCluster(final int servers) throws IOException {
23222323 conf .setBoolean ("mapreduce.reduce.speculative" , false );
23232324 ////
23242325
2326+ // Yarn container runs in independent JVM. We need to pass the argument manually here if the
2327+ // JDK version >= 17. Otherwise, the MiniMRCluster will fail.
2328+ if (JVM .getJVMSpecVersion () >= 17 ) {
2329+ String jvmOpts = conf .get ("yarn.app.mapreduce.am.command-opts" , "" );
2330+ conf .set ("yarn.app.mapreduce.am.command-opts" ,
2331+ jvmOpts + " --add-opens java.base/java.lang=ALL-UNNAMED" );
2332+ }
2333+
23252334 // Allow the user to override FS URI for this map-reduce cluster to use.
23262335 mrCluster =
23272336 new MiniMRCluster (servers , FS_URI != null ? FS_URI : FileSystem .get (conf ).getUri ().toString (),
You can’t perform that action at this time.
0 commit comments