private String getPort(String hostName, Map<String, String> yarnConfig, boolean useHttps) {
    if (yarnConfig.containsKey(PROPERTY_HA_RM_IDS)) {
      // ha mode
      String rmId = getConfigResourceManagerId(yarnConfig, hostName);
      return useHttps ?
          getConfigPortValue(yarnConfig, String.format(PROPERTY_WEBAPP_HTTPS_ADDRESS_TEMPLATE, rmId), "8090") :
          getConfigPortValue(yarnConfig, String.format(PROPERTY_WEBAPP_ADDRESS_TEMPLATE, rmId), "8088");
    }
    //non ha mode
    return useHttps ?
        getConfigPortValue(yarnConfig, PROPERTY_WEBAPP_HTTPS_ADDRESS, "8090") :
        getConfigPortValue(yarnConfig, PROPERTY_WEBAPP_ADDRESS, "8088");
  }
Resource manager specific HTTP property request.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceManagerHttpPropertyRequest.java