public List<String> makeLauncherArgs(AppConfig appConf, String statusdir,
                     String completedUrl,
                     List<String> copyFiles,
                     boolean enablelog,
                     Boolean enableJobReconnect,
                     JobType jobType) {
    ArrayList<String> args = new ArrayList<String>();

    //note that in ToolRunner this is expected to be a local FS path
    //see GenericOptionsParser.getLibJars()
    args.add("-libjars");

    // Include shim and admin specified libjars
    String libJars = String.format("%s,%s", getShimLibjars(), appConf.libJars());
    args.add(libJars);

    addCacheFiles(args, appConf);

    // Hadoop vars
    addDef(args, "user.name", runAs);
    addDef(args, AppConfig.HADOOP_SPECULATIVE_NAME, "false");
    addDef(args, AppConfig.HADOOP_CHILD_JAVA_OPTS, appConf.controllerMRChildOpts());

    // Internal vars
    addDef(args, TempletonControllerJob.STATUSDIR_NAME, statusdir);
    //Use of ToolRunner "-files" option could be considered here
    addDef(args, TempletonControllerJob.COPY_NAME,
      TempletonUtils.encodeArray(copyFiles));
    addDef(args, TempletonControllerJob.OVERRIDE_CLASSPATH,
      makeOverrideClasspath(appConf));
    addDef(args, TempletonControllerJob.ENABLE_LOG,
      Boolean.toString(enablelog));
    addDef(args, TempletonControllerJob.JOB_TYPE,
      jobType.toString());
    addDef(args, TempletonControllerJob.TEMPLETON_JOB_LAUNCH_TIME_NAME,
      Long.toString(System.currentTimeMillis()));

    if (enableJobReconnect == null) {
      // If enablejobreconnect param was not passed by a user, use a cluster
      // wide default
      if (appConf.enableJobReconnectDefault() != null) {
        enableJobReconnect = Boolean.parseBoolean(appConf.enableJobReconnectDefault());
      } else {
        // default is false
        enableJobReconnect = false;
      }
    }
    addDef(args, TempletonControllerJob.ENABLE_JOB_RECONNECT,
        Boolean.toString(enableJobReconnect));

    // Hadoop queue information
    addDef(args, "mapred.job.queue.name", appConf.hadoopQueueName());

    // Job vars
    addStorageVars(args);
    addCompletionVars(args, completedUrl);

    return args;
  }
Enqueue the TempletonControllerJob directly calling doAs.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/LauncherDelegator.java