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() |
void |
hardStop()
Signals this adaptor to come to an abrupt stop, as quickly as it can.
|
String |
parseArgs(String params)
Parse args, return stream name.
|
long |
shutdown()
Signals this adaptor to come to an orderly stop.
|
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(ChunkReceiver eq) |
String |
toString() |
deregisterAndStop, getType, 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
public void start(long offset)
start
in class AbstractAdaptor
public String getCurrentStatus()
Adaptor
Adaptor.getCurrentStatus()
public String getStreamName()
public String parseArgs(String params)
Adaptor
public void hardStop() throws AdaptorException
Adaptor
AdaptorException
public long shutdown() throws AdaptorException
Adaptor
AdaptorException
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(ChunkReceiver eq) throws InterruptedException
InterruptedException
Copyright © ${year} The Apache Software Foundation