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
|
protected long |
lastSlurpTime
The timestamp of last slurping.
|
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, start
public 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
protected long lastSlurpTime
public void start(long offset)
start
in class AbstractAdaptor
public String getCurrentStatus()
Adaptor
Adaptor.getCurrentStatus()
public String getStreamName()
public String parseArgs(String params)
parseArgs
in class AbstractAdaptor
public long shutdown(AdaptorShutdownPolicy shutdownPolicy) throws AdaptorException
Adaptor
AdaptorException
protected 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 fromInterruptedException
protected boolean slurp(long len, RandomAccessFile reader) throws IOException, InterruptedException
IOException
InterruptedException
public boolean tailFile() throws InterruptedException
InterruptedException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.