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 123123import org .apache .hadoop .hbase .util .EnvironmentEdgeManager ;
124124import org .apache .hadoop .hbase .util .FSTableDescriptors ;
125125import org .apache .hadoop .hbase .util .FSUtils ;
126+ import org .apache .hadoop .hbase .util .JVM ;
126127import org .apache .hadoop .hbase .util .JVMClusterUtil ;
127128import org .apache .hadoop .hbase .util .JVMClusterUtil .MasterThread ;
128129import org .apache .hadoop .hbase .util .JVMClusterUtil .RegionServerThread ;
@@ -2908,6 +2909,14 @@ private void startMiniMapReduceCluster(final int servers) throws IOException {
29082909 conf .setBoolean ("mapreduce.reduce.speculative" , false );
29092910 ////
29102911
2912+ // Yarn container runs in independent JVM. We need to pass the argument manually here if the
2913+ // JDK version >= 17. Otherwise, the MiniMRCluster will fail.
2914+ if (JVM .getJVMSpecVersion () >= 17 ) {
2915+ String jvmOpts = conf .get ("yarn.app.mapreduce.am.command-opts" , "" );
2916+ conf .set ("yarn.app.mapreduce.am.command-opts" ,
2917+ jvmOpts + " --add-opens java.base/java.lang=ALL-UNNAMED" );
2918+ }
2919+
29112920 // Allow the user to override FS URI for this map-reduce cluster to use.
29122921 mrCluster = new MiniMRCluster (servers ,
29132922 FS_URI != null ? FS_URI : FileSystem .get (conf ).getUri ().toString (), 1 ,
You can’t perform that action at this time.
0 commit comments