chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r939850 - in /hadoop/chukwa/trunk: CHANGES.txt src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java
Date Fri, 30 Apr 2010 22:26:42 GMT
Author: asrabkin
Date: Fri Apr 30 22:26:42 2010
New Revision: 939850

URL: http://svn.apache.org/viewvc?rev=939850&view=rev
Log:
CHUKWA-485. Fix TSProcessor handling of some dates. Contributed by Bill Graham

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=939850&r1=939849&r2=939850&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Fri Apr 30 22:26:42 2010
@@ -22,6 +22,8 @@ Trunk (unreleased changes)
 
   BUG FIXES
 
+    CHUKWA-485. Fix TSProcessor handling of some dates. (Bill Graham via asrabkin)
+
     CHUKWA-478. Fixed TestSocketTee intermittent failure.  (Chris Douglas via Eric Yang)
 
 Chukwa 0.4 

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java?rev=939850&r1=939849&r2=939850&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java
Fri Apr 30 22:26:42 2010
@@ -70,15 +70,6 @@ public class TsProcessor extends Abstrac
   public TsProcessor() {
     datePatternMap = new HashMap<String, Pattern>();
     dateFormatMap = new HashMap<String, SimpleDateFormat>();
-
-//    StringBuilder format = new StringBuilder();
-//    format.append("TsProcessor.time.format");
-//    format.append(chunk.getDataType());
-//    if(conf.get(format.toString())!=null) {
-//     sdf = new SimpleDateFormat(conf.get(format.toString()));
-//    } else {
-//     sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
-//    }
   }
 
   @Override
@@ -102,7 +93,7 @@ public class TsProcessor extends Abstrac
         }
       }
       else {
-        dStr = recordEntry.substring(0, sdf.toPattern().length());
+        dStr = recordEntry;
       }
 
       Date d = sdf.parse(dStr);

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java?rev=939850&r1=939849&r2=939850&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java
(original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java
Fri Apr 30 22:26:42 2010
@@ -68,6 +68,15 @@ public class TestTsProcessor extends Tes
     doTest(date, record);
   }
 
+  public void testCustomDefaultFormat2() {
+    // this date format produces a date that longer than the format, since z
+    // expands to something like PDT
+    jobConf.set("TsProcessor.default.time.format", "yyyy--MM--dd HH::mm::ss SSS,z");
+
+    String record = buildSampleSimpleRecord(date, "yyyy--MM--dd HH::mm::ss SSS,z");
+    doTest(date, record);
+  }
+
   public void testCustomDataTypeFormat() {
     jobConf.set("TsProcessor.time.format." + DATA_TYPE, "yyyy--MM--dd HH::mm::ss SSS");
 



Mime
View raw message