public class LWFTAdaptor extends AbstractAdaptor
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
static int |
DEFAULT_MAX_READ_SIZE
This is the maximum amount we'll read from any one file before moving on to
the next.
|
protected long |
fileReadOffset
next PHYSICAL offset to read
|
static int |
MAX_READ_SIZE |
static String |
MAX_READ_SIZE_OPT |
protected long |
offsetOfFirstByte
The logical offset of the first byte of the file
|
protected static org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailer |
tailer |
adaptorID, control, dest, type| Constructor and Description |
|---|
LWFTAdaptor() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
extractRecords(ChunkReceiver eq,
long buffOffsetInFile,
byte[] buf)
Extract records from a byte sequence
|
String |
getCurrentStatus()
Return the adaptor's state Should not include class name or byte
offset, which are written by caller.
|
String |
getStreamName() |
String |
parseArgs(String params) |
long |
shutdown(AdaptorShutdownPolicy shutdownPolicy)
Signals this adaptor to come to an orderly stop.
|
protected boolean |
slurp(long len,
RandomAccessFile reader) |
void |
start(long offset) |
boolean |
tailFile() |
String |
toString() |
deregisterAndStop, getType, hardStop, parseArgs, shutdown, startpublic static final int DEFAULT_MAX_READ_SIZE
public static final String MAX_READ_SIZE_OPT
public static int MAX_READ_SIZE
protected static org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.FileTailer tailer
protected long fileReadOffset
protected long offsetOfFirstByte
protected org.apache.hadoop.conf.Configuration conf
public void start(long offset)
start in class AbstractAdaptorpublic String getCurrentStatus()
AdaptorAdaptor.getCurrentStatus()public String getStreamName()
public String parseArgs(String params)
parseArgs in class AbstractAdaptorpublic long shutdown(AdaptorShutdownPolicy shutdownPolicy) throws AdaptorException
AdaptorAdaptorExceptionprotected int extractRecords(ChunkReceiver eq, long buffOffsetInFile, byte[] buf) throws InterruptedException
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 fromInterruptedExceptionprotected boolean slurp(long len,
RandomAccessFile reader)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean tailFile()
throws InterruptedException
InterruptedExceptionCopyright © ${year} The Apache Software Foundation