// setup the local and user working directories
FileSystem local = FileSystem.getLocal(conf);
LocalDirAllocator lDirAlloc = new LocalDirAllocator("mapred.local.dir");
Path workDirName;
boolean workDirExists = lDirAlloc.ifExists(MRConstants.WORKDIR, conf);
if (workDirExists) {
workDirName = TaskRunner.formWorkDir(lDirAlloc, conf);
} else {
workDirName = lDirAlloc.getLocalPathForWrite(MRConstants.WORKDIR,
conf);