List of usage examples for org.apache.hadoop.yarn.webapp.util WebAppUtils getProxyHostsAndPortsForAmFilter
public static List<String> getProxyHostsAndPortsForAmFilter(Configuration conf)
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); }/*from ww w.ja v a2 s .c om*/ 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()); }