private JSONObject createConfigJson() throws JSONException {
    // extract configs for processing by the python fragments in YARN Service
    JSONObject configs = new JSONObject();

    configs.put("java.home", javaHome);

    configs.put(ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB.varname,
        conf.getLongVar(ConfVars.LLAP_DAEMON_YARN_CONTAINER_MB));

    configs.put(ConfVars.LLAP_IO_MEMORY_MAX_SIZE.varname, conf.getSizeVar(ConfVars.LLAP_IO_MEMORY_MAX_SIZE));

    configs.put(ConfVars.LLAP_ALLOCATOR_DIRECT.varname, conf.getBoolVar(HiveConf.ConfVars.LLAP_ALLOCATOR_DIRECT));

    configs.put(ConfVars.LLAP_DAEMON_MEMORY_PER_INSTANCE_MB.varname,
        conf.getIntVar(ConfVars.LLAP_DAEMON_MEMORY_PER_INSTANCE_MB));

    configs.put(ConfVars.LLAP_DAEMON_VCPUS_PER_INSTANCE.varname,
        conf.getIntVar(ConfVars.LLAP_DAEMON_VCPUS_PER_INSTANCE));

    configs.put(ConfVars.LLAP_DAEMON_NUM_EXECUTORS.varname, conf.getIntVar(ConfVars.LLAP_DAEMON_NUM_EXECUTORS));

    // Let YARN pick the queue name, if it isn't provided in hive-site, or via the command-line
    if (conf.getVar(ConfVars.LLAP_DAEMON_QUEUE_NAME) != null) {
      configs.put(ConfVars.LLAP_DAEMON_QUEUE_NAME.varname, conf.getVar(ConfVars.LLAP_DAEMON_QUEUE_NAME));
    }

    // Propagate the cluster name to the script.
    String clusterHosts = conf.getVar(ConfVars.LLAP_DAEMON_SERVICE_HOSTS);
    if (!StringUtils.isEmpty(clusterHosts) && clusterHosts.startsWith("@") && clusterHosts.length() > 1) {
      configs.put(CONFIG_CLUSTER_NAME, clusterHosts.substring(1));
    }

    configs.put(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
        conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, -1));

    configs.put(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES,
        conf.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES, -1));

    long maxDirect = (xmx > 0 && cache > 0 && xmx < cache * 1.25) ? (long) (cache * 1.25) : -1;
    configs.put("max_direct_memory", Long.toString(maxDirect));

    configs.put(ConfVars.LLAP_HDFS_PACKAGE_DIR.varname,
            conf.getVar(ConfVars.LLAP_HDFS_PACKAGE_DIR));

    return configs;
  }
Creates the config json for llap start.
llap-server/src/java/org/apache/hadoop/hive/llap/cli/service/LlapConfigJsonCreator.java