private String getEntityAsJson(String path, String entityName) throws IOException {
    HttpGet getRequest = new HttpGet(path);
    HttpResponse httpResponse = httpClient.execute(appMasterHost, getRequest);

    StatusLine status = httpResponse.getStatusLine();
    if (status.getStatusCode() != HttpStatus.SC_OK) {
      throw new SamzaException(String.format(
          "Error retrieving %s from host %s. Response: %s",
          entityName,
          appMasterHost.toURI(),
          status.getReasonPhrase()));
    }

    return EntityUtils.toString(httpResponse.getEntity());
  }
@return  the config as a map of key to value
@throws IOException if there was an error fetching the config from the servlet.
samza-yarn/src/main/java/org/apache/samza/webapp/ApplicationMasterRestClient.java