From 1e4b1177f5c6a80df122b62527aa7b5f42b6e29f Mon Sep 17 00:00:00 2001 From: Konstantin Shvachko Date: Thu, 15 Sep 2011 01:49:05 +0000 Subject: [PATCH] MAPREDUCE-2991. queueinfo.jsp fails if queue names contain special symbols. Contributed by Priyo Mustafi. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1170922 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ hadoop-mapreduce-project/src/webapps/job/queueinfo.jsp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 8aa181111e6..876a6085009 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1874,6 +1874,9 @@ Release 0.22.0 - Unreleased MAPREDUCE-2767. Remove Linux task-controller. (Milind Bhandarkar via shv) + MAPREDUCE-2991. queueinfo.jsp fails to show queue status for Capacity + scheduler if queue names contain special symbols. (Priyo Mustafi via shv) + Release 0.21.1 - Unreleased NEW FEATURES diff --git a/hadoop-mapreduce-project/src/webapps/job/queueinfo.jsp b/hadoop-mapreduce-project/src/webapps/job/queueinfo.jsp index 305f0ad78ff..0825fe9af56 100644 --- a/hadoop-mapreduce-project/src/webapps/job/queueinfo.jsp +++ b/hadoop-mapreduce-project/src/webapps/job/queueinfo.jsp @@ -21,6 +21,7 @@ <%@ page contentType="text/html; charset=UTF-8" import="org.apache.hadoop.mapred.*" +import="org.apache.commons.lang.StringUtils" import="javax.servlet.*" import="javax.servlet.http.*" import="java.io.*" @@ -51,7 +52,8 @@ import="java.util.*" return ""; } for (JobQueueInfo queueInfo : children) { - String variableName = queueInfo.getQueueName().replace(":", "_"); + String variableName = StringUtils.replaceChars(queueInfo.getQueueName(), + ":-*+#.^", "_______"); String label = queueInfo.getQueueName().split(":")[queueInfo .getQueueName().split(":").length - 1]; str.append(String.format(