hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject svn commit: r1576944 - in /hadoop/common/branches/branch-2.4/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/ hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/...
Date Wed, 12 Mar 2014 22:00:26 GMT
Author: jlowe
Date: Wed Mar 12 22:00:26 2014
New Revision: 1576944

URL: http://svn.apache.org/r1576944
Log:
svn merge -c 1576940 FIXES: MAPREDUCE-5778. JobSummary does not escape newlines in the job
name. Contributed by Akira AJISAKA

Added:
    hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestJobSummary.java
      - copied unchanged from r1576940, hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/jobhistory/TestJobSummary.java
Modified:
    hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobSummary.java

Modified: hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/CHANGES.txt?rev=1576944&r1=1576943&r2=1576944&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/CHANGES.txt Wed Mar 12 22:00:26
2014
@@ -51,6 +51,9 @@ Release 2.4.0 - UNRELEASED
     MAPREDUCE-5028. Fixed a bug in MapTask that was causing mappers to fail
     when a large value of io.sort.mb is set. (Karthik Kambatla via vinodkv)
 
+    MAPREDUCE-5778. JobSummary does not escape newlines in the job name (Akira
+    AJISAKA via jlowe)
+
 Release 2.3.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobSummary.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobSummary.java?rev=1576944&r1=1576943&r2=1576944&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobSummary.java
(original)
+++ hadoop/common/branches/branch-2.4/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobSummary.java
Wed Mar 12 22:00:26 2014
@@ -228,8 +228,10 @@ public class JobSummary {
     }
 
     <T> SummaryBuilder add(String key, T value) {
-      return _add(key, StringUtils.escapeString(String.valueOf(value),
-          StringUtils.ESCAPE_CHAR, charsToEscape));
+      String escapedString = StringUtils.escapeString(String.valueOf(value), 
+          StringUtils.ESCAPE_CHAR, charsToEscape).replaceAll("\n", "\\\\n")
+                                                 .replaceAll("\r", "\\\\r");
+      return _add(key, escapedString);
     }
 
     SummaryBuilder add(SummaryBuilder summary) {



Mime
View raw message