org.apache.hadoop.chukwa.datacollection.adaptor.filetailer
Class CharFileTailingAdaptorUTF8NewLineEscaped

java.lang.Object
  extended by org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor
      extended by org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped
All Implemented Interfaces:
Adaptor

public class CharFileTailingAdaptorUTF8NewLineEscaped
extends FileTailingAdaptor

A subclass of FileTailingAdaptor that reads UTF8/ascii files and splits records at non-escaped carriage returns


Field Summary
 
Fields inherited from class org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor
adaptorID, conf, DEFAULT_MAX_READ_SIZE, fileReadOffset, GRACEFUL_PERIOD, MAX_READ_SIZE, MAX_RETRIES, reader, type
 
Constructor Summary
CharFileTailingAdaptorUTF8NewLineEscaped()
           
 
Method Summary
protected  int extractRecords(ChunkReceiver eq, long buffOffsetInFile, byte[] buf)
          Note: this method uses a temporary ArrayList (shared across instances).
 String toString()
           
 
Methods inherited from class org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor
getCurrentStatus, getStreamName, getType, hardStop, shutdown, start, tailFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharFileTailingAdaptorUTF8NewLineEscaped

public CharFileTailingAdaptorUTF8NewLineEscaped()
Method Detail

extractRecords

protected int extractRecords(ChunkReceiver eq,
                             long buffOffsetInFile,
                             byte[] buf)
                      throws InterruptedException
Note: this method uses a temporary ArrayList (shared across instances). This means we're copying ints each time. This could be a performance issue. Also, 'offsets' never shrinks, and will be of size proportional to the largest number of lines ever seen in an event.

Overrides:
extractRecords in class FileTailingAdaptor
Parameters:
eq - the queue to stick the new chunk[s] in
buffOffsetInFile - the byte offset in the stream at which buf[] begins
buf - the byte buffer to extract records from
Returns:
the number of bytes processed
Throws:
InterruptedException

toString

public String toString()
Overrides:
toString in class FileTailingAdaptor


Copyright © ${year} The Apache Software Foundation