code: public Path getSpillFileForWrite(TaskAttemptID mapTaskId, int spillNumber, 
           long size) throws IOException {
      return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir(
                         jobId.toString(), mapTaskId.toString())
                         + "/spill" + 
                         spillNumber + ".out", size, conf);
    }
docs: Create a local map spill file name.
  @param mapTaskId a map task id
  @param spillNumber the number
  @param size the size of the file