Modifier and Type | Field and Description |
---|---|
protected long |
adaptorID |
protected ChunkReceiver |
dest |
protected long |
fileReadOffset |
protected RandomAccessFile |
reader |
protected boolean |
shutdownCalled |
protected File |
toWatch |
protected String |
type |
Constructor and Description |
---|
FileAdaptor() |
Modifier and Type | Method and Description |
---|---|
protected int |
extractRecords(ChunkReceiver eq,
long buffOffsetInFile,
byte[] buf,
long fileTime)
Extract records from a byte sequence
|
String |
getCurrentStatus()
Return the adaptor's state Should not include class name, datatype or byte
offset, which are written by caller.
|
String |
getStreamName()
Return the stream name
|
String |
getType() |
void |
hardStop()
Stop tailing the file, effective immediately.
|
long |
shutdown()
We want to keep trying
|
void |
start(long adaptorID,
String type,
String params,
long bytes,
ChunkReceiver dest)
Start this adaptor
|
protected File toWatch
protected RandomAccessFile reader
protected long fileReadOffset
protected String type
protected ChunkReceiver dest
protected long adaptorID
protected boolean shutdownCalled
public void start(long adaptorID, String type, String params, long bytes, ChunkReceiver dest)
Adaptor
public long shutdown() throws AdaptorException
shutdown
in interface Adaptor
AdaptorException
Adaptor.shutdown()
public void hardStop() throws AdaptorException
hardStop
in interface Adaptor
AdaptorException
public String getStreamName()
Adaptor
getStreamName
in interface Adaptor
protected int extractRecords(ChunkReceiver eq, long buffOffsetInFile, byte[] buf, long fileTime) 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
public String getCurrentStatus() throws AdaptorException
Adaptor
getCurrentStatus
in interface Adaptor
AdaptorException
Copyright © ${year} The Apache Software Foundation