org.apache.hadoop.chukwa.datacollection.adaptor.filetailer
Class CharFileTailingAdaptorUTF8NewLineEscaped
java.lang.Object
org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor
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
CharFileTailingAdaptorUTF8NewLineEscaped
public CharFileTailingAdaptorUTF8NewLineEscaped()
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] inbuffOffsetInFile
- the byte offset in the stream at which buf[] beginsbuf
- 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