private void startCluster(Configuration conf, String name, String packageName, Path packageDir, String queue) {
    LOG.info("Starting cluster with " + name + ", " + packageName + ", " + queue + ", " + packageDir);
    ServiceClient sc;
    try {
      sc = LlapSliderUtils.createServiceClient(conf);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    try {
      try {
        LOG.info("Executing the stop command");
        sc.actionStop(name, true);
      } catch (Exception ex) { // Ignore exceptions from stop
        LOG.info(ex.getLocalizedMessage());
      }
      try {
        LOG.info("Executing the destroy command");
        sc.actionDestroy(name);
      } catch (Exception ex) { // Ignore exceptions from destroy
        LOG.info(ex.getLocalizedMessage());
      }
      LOG.info("Uploading the app tarball");
      CoreFileSystem fs = new CoreFileSystem(conf);
      String llapPackageDir = HiveConf.getVar(conf, HiveConf.ConfVars.LLAP_HDFS_PACKAGE_DIR)
              + LLAP_RELATIVE_PACKAGE_DIR;
      fs.createWithPermissions(new Path(llapPackageDir), FsPermission.getDirDefault());
      fs.copyLocalFileToHdfs(new File(packageDir.toString(), packageName), new Path(llapPackageDir),
          new FsPermission("755"));

      LOG.info("Executing the launch command");
      File yarnfile = new File(new Path(packageDir, "Yarnfile").toString());
      Long lifetime = null; // unlimited lifetime
      sc.actionLaunch(yarnfile.getAbsolutePath(), name, lifetime, queue);
      LOG.debug("Started the cluster via service API");
    } catch (YarnException | IOException e) {
      throw new RuntimeException(e);
    } finally {
      try {
        sc.close();
      } catch (IOException e) {
        LOG.info("Failed to close service client", e);
      }
    }
  }
This is a working configuration for the instance to merge various variables.
It is not written out for llap server usage
llap-server/src/java/org/apache/hadoop/hive/llap/cli/service/LlapServiceDriver.java