code: public static void rename(FileSystem fs, String oldName, String newName)
      throws IOException {
      Path oldDir = new Path(oldName);
      Path newDir = new Path(newName);
      if (!fs.rename(oldDir, newDir)) {
        throw new IOException("Could not rename " + oldDir + " to " + newDir);
      }
    }
docs: Renames an existing map directory.