@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) {
    try {
      if (!HttpServer.isInstrumentationAccessAllowed(getServletContext(), request, response)) {
        return;
      }
      PrintWriter writer = null;
      String clusterName =
          HiveConf.getVar(getConfFromContext(), HiveConf.ConfVars.LLAP_DAEMON_SERVICE_HOSTS);

      try {
        response.setContentType(HttpConstants.CONTENT_TYPE_JSON);
        response.setHeader(HttpConstants.ACCESS_CONTROL_ALLOW_METHODS, HttpConstants.METHOD_GET);
        response.setHeader(HttpConstants.ACCESS_CONTROL_ALLOW_ORIGIN, HttpConstants.WILDCARD);
        response.setHeader(HttpConstants.CACHE_CONTROL, "no-transform,public,max-age=60,s-maxage=60");

        writer = response.getWriter();

        if (clusterName != null) {
          clusterName = clusterName.trim();
        }

        if (clusterName == null || clusterName.isEmpty()) {
          writer.print("{\"LLAP\": \"No llap daemons configured. ");
          writer.print("Check hive.llap.daemon.service.hosts.\"}");
          return;
        }

        if (clusterName.startsWith("@")) {
          clusterName = clusterName.substring(1);
        }

        LOG.info("Retrieving info for cluster: " + clusterName);
        LlapStatusServiceDriver driver = new LlapStatusServiceDriver();
        ExitCode ret = driver.run(LlapStatusServiceCommandLine.parseArguments(new String[] {"-n", clusterName}), 0);
        if (ret == ExitCode.SUCCESS) {
          driver.outputJson(writer);
        }

      } finally {
        if (writer != null) {
          writer.close();
        }
      }
    } catch (Exception e) {
      LOG.error("Caught exception while processing llap status request", e);
      response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    }
  }
Process a GET request for the specified resource.

@param request
         The servlet request we are processing
@param response
         The servlet response we are creating
service/src/java/org/apache/hive/http/LlapServlet.java