List of usage examples for org.apache.hadoop.yarn.webapp.util WebAppUtils getProxyHostAndPort
public static String getProxyHostAndPort(Configuration conf)
From source file:com.datatorrent.stram.security.StramWSFilterInitializer.java
License:Apache License
@Override public void initFilter(FilterContainer container, Configuration conf) { Map<String, String> params = new HashMap<String, String>(); String proxy = WebAppUtils.getProxyHostAndPort(conf); String[] parts = proxy.split(":"); params.put(StramWSFilter.PROXY_HOST, parts[0]); params.put(StramWSFilter.PROXY_URI_BASE, ConfigUtils.getSchemePrefix(new YarnConfiguration()) + proxy + System.getenv(ApplicationConstants.APPLICATION_WEB_PROXY_BASE_ENV)); container.addFilter(FILTER_NAME, FILTER_CLASS, params); }
From source file:org.apache.slider.server.appmaster.web.rest.InsecureAmFilterInitializer.java
License:Apache License
@Override public void initFilter(FilterContainer container, Configuration conf) { configuration = conf;/* ww w.j a va2 s .c o m*/ Map<String, String> params = new HashMap<String, String>(); String proxy = WebAppUtils.getProxyHostAndPort(conf); String[] parts = proxy.split(":"); params.put(InsecureAmFilter.PROXY_HOST, parts[0]); // todo: eventually call WebAppUtils.getHttpSchemePrefix params.put(InsecureAmFilter.PROXY_URI_BASE, getHttpSchemePrefix() + proxy + getApplicationWebProxyBase()); params.put(InsecureAmFilter.WS_CONTEXT_ROOT, RestPaths.WS_CONTEXT_ROOT); container.addFilter(FILTER_NAME, FILTER_CLASS, params); }
From source file:org.apache.slider.server.appmaster.web.SliderAmFilterInitializer.java
License:Apache License
@Override public void initFilter(FilterContainer container, Configuration conf) { configuration = conf;//from w ww . j av a 2 s .com Map<String, String> params = new HashMap<String, String>(); String proxy = WebAppUtils.getProxyHostAndPort(conf); String[] parts = proxy.split(":"); params.put(SliderAmIpFilter.PROXY_HOST, parts[0]); // todo: eventually call WebAppUtils.getHttpSchemePrefix params.put(SliderAmIpFilter.PROXY_URI_BASE, getHttpSchemePrefix() + proxy + getApplicationWebProxyBase()); params.put(SliderAmIpFilter.WS_CONTEXT_ROOT, conf.get(SliderAmIpFilter.WS_CONTEXT_ROOT)); container.addFilter(FILTER_NAME, FILTER_CLASS, params); }