org.apache.hadoop.chukwa.extraction.demux.processor.mapper
Class TsProcessor

java.lang.Object
  extended by org.apache.hadoop.chukwa.extraction.demux.processor.mapper.AbstractProcessor
      extended by org.apache.hadoop.chukwa.extraction.demux.processor.mapper.TsProcessor
All Implemented Interfaces:
MapProcessor

public class TsProcessor
extends AbstractProcessor

TsProcessor is a generic processor that can be configured to find the timestamp in the text of a record. By default, this class expects that a record starts with a date in this format: yyyy-MM-dd HH:mm:ss,SSS

This format can be changed with the following configurations.

If the time string is not at the beginning of the record you can configure a regular expression to locate the timestamp text with either of the following configurations. The text found in group 1 of the regular expression match will be used with the configured date format.


Field Summary
static String DEFAULT_DATE_FORMAT
           
 
Fields inherited from class org.apache.hadoop.chukwa.extraction.demux.processor.mapper.AbstractProcessor
archiveKey, chunk, key
 
Constructor Summary
TsProcessor()
           
 
Method Summary
protected  void parse(String recordEntry, org.apache.hadoop.mapred.OutputCollector<ChukwaRecordKey,ChukwaRecord> output, org.apache.hadoop.mapred.Reporter reporter)
           
 
Methods inherited from class org.apache.hadoop.chukwa.extraction.demux.processor.mapper.AbstractProcessor
buildGenericRecord, hasNext, nextLine, process, reset, saveChunkInError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATE_FORMAT

public static final String DEFAULT_DATE_FORMAT
See Also:
Constant Field Values
Constructor Detail

TsProcessor

public TsProcessor()
Method Detail

parse

protected void parse(String recordEntry,
                     org.apache.hadoop.mapred.OutputCollector<ChukwaRecordKey,ChukwaRecord> output,
                     org.apache.hadoop.mapred.Reporter reporter)
              throws Throwable
Specified by:
parse in class AbstractProcessor
Throws:
Throwable


Copyright © 2011 Apache Software Foundation. All Rights Reserved.