|
@@ -609,8 +609,12 @@ public class LocalJobRunner implements ClientProtocol {
|
|
|
// JobSubmissionProtocol methods
|
|
|
|
|
|
private static int jobid = 0;
|
|
|
+ // used for making sure that local jobs run in different jvms don't
|
|
|
+ // collide on staging or job directories
|
|
|
+ private int randid;
|
|
|
+
|
|
|
public synchronized org.apache.hadoop.mapreduce.JobID getNewJobID() {
|
|
|
- return new org.apache.hadoop.mapreduce.JobID("local", ++jobid);
|
|
|
+ return new org.apache.hadoop.mapreduce.JobID("local" + randid, ++jobid);
|
|
|
}
|
|
|
|
|
|
public org.apache.hadoop.mapreduce.JobStatus submitJob(
|
|
@@ -739,10 +743,11 @@ public class LocalJobRunner implements ClientProtocol {
|
|
|
"/tmp/hadoop/mapred/staging"));
|
|
|
UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
|
|
|
String user;
|
|
|
+ randid = rand.nextInt(Integer.MAX_VALUE);
|
|
|
if (ugi != null) {
|
|
|
- user = ugi.getShortUserName() + rand.nextInt();
|
|
|
+ user = ugi.getShortUserName() + randid;
|
|
|
} else {
|
|
|
- user = "dummy" + rand.nextInt();
|
|
|
+ user = "dummy" + randid;
|
|
|
}
|
|
|
return fs.makeQualified(new Path(stagingRootDir, user+"/.staging")).toString();
|
|
|
}
|