Example usage for org.apache.hadoop.yarn.webapp.util WebAppUtils getHttpSchemePrefix

List of usage examples for org.apache.hadoop.yarn.webapp.util WebAppUtils getHttpSchemePrefix

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.webapp.util WebAppUtils getHttpSchemePrefix.

Prototype

public static String getHttpSchemePrefix(Configuration conf) 

Source Link

Document

Choose which scheme (HTTP or HTTPS) to use when generating a URL based on the configuration.

Usage

From source file:org.apache.slider.server.appmaster.web.rest.InsecureAmFilterInitializer.java

License:Apache License

private void classicAmFilterInitializerInit(FilterContainer container, Configuration conf) {
    Map<String, String> params = new HashMap<String, String>();
    List<String> proxies = WebAppUtils.getProxyHostsAndPortsForAmFilter(conf);
    StringBuilder sb = new StringBuilder();
    for (String proxy : proxies) {
        sb.append(proxy.split(":")[0]).append(PROXY_HOSTS_DELIMITER);
    }/* w  w  w . j  a v  a  2s. c  o m*/
    sb.setLength(sb.length() - 1);
    params.put(PROXY_HOSTS, sb.toString());

    String prefix = WebAppUtils.getHttpSchemePrefix(conf);
    String proxyBase = getApplicationWebProxyBase();
    sb = new StringBuilder();
    for (String proxy : proxies) {
        sb.append(prefix).append(proxy).append(proxyBase).append(PROXY_HOSTS_DELIMITER);
    }
    sb.setLength(sb.length() - 1);
    params.put(PROXY_URI_BASES, sb.toString());

}