diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/pipes/Application.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/pipes/Application.java index 83d250981f..5c8aab97dc 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/pipes/Application.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/pipes/Application.java @@ -45,6 +45,7 @@ import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.TaskAttemptID; import org.apache.hadoop.mapred.TaskLog; +import org.apache.hadoop.mapreduce.MRConfig; import org.apache.hadoop.mapreduce.MRJobConfig; import org.apache.hadoop.mapreduce.filecache.DistributedCache; import org.apache.hadoop.mapreduce.security.SecureShuffleUtils; @@ -103,8 +104,8 @@ class Application rReader = new ReaderPipesMapRunner(); - JobConf conf = new JobConf(); conf.set(Submitter.IS_JAVA_RR, "true"); // for stdour and stderror @@ -162,7 +163,7 @@ public void testApplication() throws Throwable { TestTaskReporter reporter = new TestTaskReporter(); - File[] psw = cleanTokenPasswordFile(); + File[] psw = cleanTokenPasswordFile(conf); try { conf.set(MRJobConfig.TASK_ATTEMPT_ID, taskName); @@ -247,7 +248,7 @@ public void testSubmitter() throws Exception { JobConf conf = new JobConf(); - File[] psw = cleanTokenPasswordFile(); + File[] psw = cleanTokenPasswordFile(conf); System.setProperty("test.build.data", "target/tmp/build/TEST_SUBMITTER_MAPPER/data"); @@ -388,8 +389,8 @@ public void testSubmitter() throws Exception { @Test public void testPipesReduser() throws Exception { - File[] psw = cleanTokenPasswordFile(); JobConf conf = new JobConf(); + File[] psw = cleanTokenPasswordFile(conf); try { Token token = new Token( "user".getBytes(), "password".getBytes(), new Text("kind"), new Text( @@ -506,14 +507,16 @@ public void progress() { } - private File[] cleanTokenPasswordFile() throws Exception { + private File[] cleanTokenPasswordFile(JobConf conf) throws Exception { File[] result = new File[2]; - result[0] = new File("./jobTokenPassword"); + result[0] = new File(conf.get(MRConfig.LOCAL_DIR) + Path.SEPARATOR + + "jobTokenPassword"); if (result[0].exists()) { FileUtil.chmod(result[0].getAbsolutePath(), "700"); assertTrue(result[0].delete()); } - result[1] = new File("./.jobTokenPassword.crc"); + result[1] = new File(conf.get(MRConfig.LOCAL_DIR) + Path.SEPARATOR + + ".jobTokenPassword.crc"); if (result[1].exists()) { FileUtil.chmod(result[1].getAbsolutePath(), "700"); result[1].delete();