| 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)
Adaptorpublic long shutdown()
throws AdaptorException
shutdown in interface AdaptorAdaptorExceptionAdaptor.shutdown()public void hardStop()
throws AdaptorException
hardStop in interface AdaptorAdaptorExceptionpublic String getStreamName()
AdaptorgetStreamName in interface Adaptorprotected 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 fromInterruptedExceptionpublic String getCurrentStatus() throws AdaptorException
AdaptorgetCurrentStatus in interface AdaptorAdaptorExceptionCopyright © ${year} The Apache Software Foundation