Skip to content

Commit

Permalink
Fix checkstyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
bteke committed Aug 10, 2023
1 parent ff1bd30 commit 30b25c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ public void testCommandLineWithLog4JConifg() throws Exception {

Assert.assertEquals(
"[" + MRApps.crossPlatformify("JAVA_HOME") + "/bin/java" +
" -Djava.net.preferIPv4Stack=true" +
" -Dhadoop.metrics.log.level=WARN " +
" -Xmx820m <ADD_OPENS> -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" +
" -Dlog4j.configuration=" + testLogPropertieFile +
" -Dyarn.app.container.log.dir=<LOG_DIR>" +
" -Dyarn.app.container.log.filesize=0" +
" -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" +
" org.apache.hadoop.mapred.YarnChild 127.0.0.1" +
" 54321" +
" attempt_0_0000_m_000000_0" +
" 0" +
" 1><LOG_DIR>/stdout" +
" 2><LOG_DIR>/stderr ]", app.launchCmdList.get(0));
" -Djava.net.preferIPv4Stack=true" +
" -Dhadoop.metrics.log.level=WARN " +
" -Xmx820m <ADD_OPENS> -Djava.io.tmpdir=" + MRApps.crossPlatformify("PWD") + "/tmp" +
" -Dlog4j.configuration=" + testLogPropertieFile +
" -Dyarn.app.container.log.dir=<LOG_DIR>" +
" -Dyarn.app.container.log.filesize=0" +
" -Dhadoop.root.logger=INFO,CLA -Dhadoop.root.logfile=syslog" +
" org.apache.hadoop.mapred.YarnChild 127.0.0.1" +
" 54321" +
" attempt_0_0000_m_000000_0" +
" 0" +
" 1><LOG_DIR>/stdout" +
" 2><LOG_DIR>/stderr ]", app.launchCmdList.get(0));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ public interface MRJobConfig {
"java.version,java.vm.name,java.class.path,java.io.tmpdir,user.dir,user.name";

/*
* Flag to indicate whether JDK17's required add-opens flags should be added to MR AM and map/reduce containers
* regardless of the user specified java opts.
* Flag to indicate whether JDK17's required add-opens flags should be added to MR AM and
* map/reduce containers regardless of the user specified java opts.
*/
public static final String MAPREDUCE_JVM_ADD_OPENS_JAVA_OPT =
"mapreduce.jvm.add-opens-as-default";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,13 @@ public void testEnvExpansion() throws IOException {
+ Apps.crossPlatformify("HADOOP_HOME") + "/share/hadoop/common/lib/*"
+ ApplicationConstants.CLASS_PATH_SEPARATOR
+ Apps.crossPlatformify("HADOOP_LOG_HOME")
+ ApplicationConstants.LOG_DIR_EXPANSION_VAR + " " + ApplicationConstants.JVM_ADD_OPENS_VAR;
+ ApplicationConstants.LOG_DIR_EXPANSION_VAR
+ " " + ApplicationConstants.JVM_ADD_OPENS_VAR;

String res = ContainerLaunch.expandEnvironment(input, logPath);

String expectedAddOpens = Shell.isJavaVersionAtLeast(17) ? "--add-opens=java.base/java.lang=ALL-UNNAMED" : "";
String expectedAddOpens = Shell.isJavaVersionAtLeast(17) ?
"--add-opens=java.base/java.lang=ALL-UNNAMED" : "";
if (Shell.WINDOWS) {
Assert.assertEquals("%HADOOP_HOME%/share/hadoop/common/*;"
+ "%HADOOP_HOME%/share/hadoop/common/lib/*;"
Expand Down

0 comments on commit 30b25c7

Please sign in to comment.