From c611707e28c7094ff0c8a9558db1c7d04bbc8b6d Mon Sep 17 00:00:00 2001 From: Jian He Date: Wed, 24 Jan 2018 11:16:54 -0800 Subject: [PATCH] YARN-7801. AmFilterInitializer should addFilter after fill all parameters. Contributed by Wangda Tan --- .../yarn/server/webproxy/amfilter/AmFilterInitializer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java index c3ddc54f3e2..27742e41a29 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java @@ -59,7 +59,6 @@ public class AmFilterInitializer extends FilterInitializer { } sb.setLength(sb.length() - 1); params.put(AmIpFilter.PROXY_URI_BASES, sb.toString()); - container.addFilter(FILTER_NAME, FILTER_CLASS, params); // Handle RM HA urls // Include yarn-site.xml in the classpath @@ -75,6 +74,8 @@ public class AmFilterInitializer extends FilterInitializer { params.put(RM_HA_URLS, StringUtils.join(",", urls)); } } + + container.addFilter(FILTER_NAME, FILTER_CLASS, params); } private Collection getRmIds(Configuration conf) {