private static void setPlanPath(Configuration conf, Path hiveScratchDir) throws IOException {
    if (getPlanPath(conf) == null) {
      // this is the unique conf ID, which is kept in JobConf as part of the plan file name
      String jobID = UUID.randomUUID().toString();
      Path planPath = new Path(hiveScratchDir, jobID);
      if (!HiveConf.getBoolVar(conf, ConfVars.HIVE_RPC_QUERY_PLAN)) {
        FileSystem fs = planPath.getFileSystem(conf);
        // since we are doing RPC creating a directory is un-necessary
        fs.mkdirs(planPath);
      }
      HiveConf.setVar(conf, HiveConf.ConfVars.PLAN, planPath.toUri().toString());
    }
  }
Returns the Map or Reduce plan
Side effect: the BaseWork returned is also placed in the gWorkMap
@param conf
@param name
@return BaseWork based on the name supplied will return null if name is null
@throws RuntimeException if the configuration files are not proper or if plan can not be loaded
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java