From 79f6118dccf809aed74dd54f46f5d77416e14aa1 Mon Sep 17 00:00:00 2001 From: Masatake Iwasaki Date: Thu, 18 Jul 2019 13:15:18 +0100 Subject: [PATCH] MAPREDUCE-6521. MiniMRYarnCluster should not create /tmp/hadoop-yarn/staging on local filesystem in unit test. Contributed by Masatake Iwasaki. Change-Id: Id74b90eb7cfb9d676188fc5aa47249ee8904a3d5 --- .../org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java index 289c17e354..299383d76b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/MiniMRYarnCluster.java @@ -119,7 +119,9 @@ public static String getResolvedMRHistoryWebAppURLWithoutScheme( @Override public void serviceInit(Configuration conf) throws Exception { conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME); - if (conf.get(MRJobConfig.MR_AM_STAGING_DIR) == null) { + String stagingDir = conf.get(MRJobConfig.MR_AM_STAGING_DIR); + if (stagingDir == null || + stagingDir.equals(MRJobConfig.DEFAULT_MR_AM_STAGING_DIR)) { conf.set(MRJobConfig.MR_AM_STAGING_DIR, new File(getTestWorkDir(), "apps_staging_dir/").getAbsolutePath()); }