|
@@ -47,6 +47,7 @@ import org.apache.hadoop.io.NullWritable;
|
|
import org.apache.hadoop.io.Writable;
|
|
import org.apache.hadoop.io.Writable;
|
|
import org.apache.hadoop.io.WritableComparable;
|
|
import org.apache.hadoop.io.WritableComparable;
|
|
import org.apache.hadoop.mapred.IFile.Writer;
|
|
import org.apache.hadoop.mapred.IFile.Writer;
|
|
|
|
+import org.apache.hadoop.mapreduce.MRConfig;
|
|
import org.apache.hadoop.mapreduce.MRJobConfig;
|
|
import org.apache.hadoop.mapreduce.MRJobConfig;
|
|
import org.apache.hadoop.mapreduce.security.TokenCache;
|
|
import org.apache.hadoop.mapreduce.security.TokenCache;
|
|
import org.apache.hadoop.mapred.Counters;
|
|
import org.apache.hadoop.mapred.Counters;
|
|
@@ -83,10 +84,10 @@ public class TestPipeApplication {
|
|
public void testRunner() throws Exception {
|
|
public void testRunner() throws Exception {
|
|
|
|
|
|
// clean old password files
|
|
// clean old password files
|
|
- File[] psw = cleanTokenPasswordFile();
|
|
|
|
|
|
+ JobConf conf = new JobConf();
|
|
|
|
+ File[] psw = cleanTokenPasswordFile(conf);
|
|
try {
|
|
try {
|
|
RecordReader<FloatWritable, NullWritable> rReader = new ReaderPipesMapRunner();
|
|
RecordReader<FloatWritable, NullWritable> rReader = new ReaderPipesMapRunner();
|
|
- JobConf conf = new JobConf();
|
|
|
|
conf.set(Submitter.IS_JAVA_RR, "true");
|
|
conf.set(Submitter.IS_JAVA_RR, "true");
|
|
// for stdour and stderror
|
|
// for stdour and stderror
|
|
|
|
|
|
@@ -162,7 +163,7 @@ public class TestPipeApplication {
|
|
|
|
|
|
TestTaskReporter reporter = new TestTaskReporter();
|
|
TestTaskReporter reporter = new TestTaskReporter();
|
|
|
|
|
|
- File[] psw = cleanTokenPasswordFile();
|
|
|
|
|
|
+ File[] psw = cleanTokenPasswordFile(conf);
|
|
try {
|
|
try {
|
|
|
|
|
|
conf.set(MRJobConfig.TASK_ATTEMPT_ID, taskName);
|
|
conf.set(MRJobConfig.TASK_ATTEMPT_ID, taskName);
|
|
@@ -247,7 +248,7 @@ public class TestPipeApplication {
|
|
|
|
|
|
JobConf conf = new JobConf();
|
|
JobConf conf = new JobConf();
|
|
|
|
|
|
- File[] psw = cleanTokenPasswordFile();
|
|
|
|
|
|
+ File[] psw = cleanTokenPasswordFile(conf);
|
|
|
|
|
|
System.setProperty("test.build.data",
|
|
System.setProperty("test.build.data",
|
|
"target/tmp/build/TEST_SUBMITTER_MAPPER/data");
|
|
"target/tmp/build/TEST_SUBMITTER_MAPPER/data");
|
|
@@ -388,8 +389,8 @@ public class TestPipeApplication {
|
|
@Test
|
|
@Test
|
|
public void testPipesReduser() throws Exception {
|
|
public void testPipesReduser() throws Exception {
|
|
|
|
|
|
- File[] psw = cleanTokenPasswordFile();
|
|
|
|
JobConf conf = new JobConf();
|
|
JobConf conf = new JobConf();
|
|
|
|
+ File[] psw = cleanTokenPasswordFile(conf);
|
|
try {
|
|
try {
|
|
Token<AMRMTokenIdentifier> token = new Token<AMRMTokenIdentifier>(
|
|
Token<AMRMTokenIdentifier> token = new Token<AMRMTokenIdentifier>(
|
|
"user".getBytes(), "password".getBytes(), new Text("kind"), new Text(
|
|
"user".getBytes(), "password".getBytes(), new Text("kind"), new Text(
|
|
@@ -506,14 +507,16 @@ public class TestPipeApplication {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private File[] cleanTokenPasswordFile() throws Exception {
|
|
|
|
|
|
+ private File[] cleanTokenPasswordFile(JobConf conf) throws Exception {
|
|
File[] result = new File[2];
|
|
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()) {
|
|
if (result[0].exists()) {
|
|
FileUtil.chmod(result[0].getAbsolutePath(), "700");
|
|
FileUtil.chmod(result[0].getAbsolutePath(), "700");
|
|
assertTrue(result[0].delete());
|
|
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()) {
|
|
if (result[1].exists()) {
|
|
FileUtil.chmod(result[1].getAbsolutePath(), "700");
|
|
FileUtil.chmod(result[1].getAbsolutePath(), "700");
|
|
result[1].delete();
|
|
result[1].delete();
|