code: public Path getLocalPathForWrite(String pathStr, long size, 
        Configuration conf) throws IOException {
      AllocatorPerContext context = obtainContext(contextCfgItemName);
      return context.getLocalPathForWrite(pathStr, size, conf);
    }
docs: Get a path from the local FS. Pass size as -1 if not known apriori. We
  round-robin over the set of disks (via the configured dirs) and return
  the first complete path which has enough space
  @param pathStr the requested path (this will be created on the first
  available disk)
  @param size the size of the file that is going to be written
  @param conf the Configuration object
  @return the complete path to the file on a local disk
  @throws IOException