org.apache.hadoop.chukwa.datacollection.adaptor.filetailer
Class CharFileTailingAdaptorUTF8
java.lang.Object
org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailingAdaptor
org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8
- All Implemented Interfaces:
- Adaptor
public class CharFileTailingAdaptorUTF8
- extends FileTailingAdaptor
A subclass of FileTailingAdaptor that reads UTF8/ascii files and splits
records at carriage returns.
Method Summary |
protected int |
extractRecords(ChunkReceiver eq,
long buffOffsetInFile,
byte[] buf)
Note: this method uses a temporary ArrayList (shared across instances). |
CharFileTailingAdaptorUTF8
public CharFileTailingAdaptorUTF8()
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
Copyright © ${year} The Apache Software Foundation