From ef636c4278f5d3e07155fbdb99aa9632c1676999 Mon Sep 17 00:00:00 2001 From: Benjamin Teke Date: Thu, 11 Jan 2024 14:51:59 +0100 Subject: [PATCH] MAPREDUCE-7468: Change add-opens flag's default value from true to false (#6436) Co-authored-by: Benjamin Teke --- .../mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java | 1 - .../main/java/org/apache/hadoop/mapreduce/MRJobConfig.java | 2 +- .../src/main/resources/mapred-default.xml | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java index e22bd44ee9..d653186edd 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TestMapReduceChildJVM.java @@ -52,7 +52,6 @@ public void testCommandLine() throws Exception { MyMRApp app = new MyMRApp(1, 0, true, this.getClass().getName(), true); Configuration conf = new Configuration(); conf.setBoolean(MRConfig.MAPREDUCE_APP_SUBMISSION_CROSS_PLATFORM, true); - conf.setBoolean(MRJobConfig.MAPREDUCE_JVM_ADD_OPENS_JAVA_OPT, false); Job job = app.submit(conf); app.waitForState(job, JobState.SUCCEEDED); app.verifyCompleted(); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java index 289159ad92..3e5bd671bc 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java @@ -312,7 +312,7 @@ public interface MRJobConfig { public static final String MAPREDUCE_JVM_ADD_OPENS_JAVA_OPT = "mapreduce.jvm.add-opens-as-default"; - public static final boolean MAPREDUCE_JVM_ADD_OPENS_JAVA_OPT_DEFAULT = true; + public static final boolean MAPREDUCE_JVM_ADD_OPENS_JAVA_OPT_DEFAULT = false; public static final String IO_SORT_FACTOR = "mapreduce.task.io.sort.factor"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml index ca144a7b15..066d80a89c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml @@ -1822,12 +1822,12 @@ mapreduce.jvm.add-opens-as-default - true + false Since on JDK17 it's no longer possible to use the reflection API to access non-public fields and methods add-opens flags should be added to MR AM and map/reduce containers regardless of the user specified java opts. Setting this to true will add the flags to the container launch commands on nodes with - JDK17 or higher. Defaults to true, but the setting has no effect on nodes using + JDK17 or higher. Defaults to false, and the setting has no effect on nodes using JDK16 and before.