|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.chukwa.datacollection.adaptor.FileAdaptor
public class FileAdaptor
File Adaptor push small size file in one chunk to collector
| Field Summary | |
|---|---|
protected long |
adaptorID
|
protected ChunkReceiver |
dest
|
protected long |
fileReadOffset
|
protected RandomAccessFile |
reader
|
protected boolean |
shutdownCalled
|
protected File |
toWatch
|
protected String |
type
|
| Constructor Summary | |
|---|---|
FileAdaptor()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected File toWatch
protected RandomAccessFile reader
protected long fileReadOffset
protected String type
protected ChunkReceiver dest
protected long adaptorID
protected boolean shutdownCalled
| Constructor Detail |
|---|
public FileAdaptor()
| Method Detail |
|---|
public void start(long adaptorID,
String type,
String params,
long bytes,
ChunkReceiver dest)
Adaptor
start in interface Adaptortype - the application type, who is starting this adaptorparams - the status string to use for configuration.bytes - the stream offset of the first byte sent by this adaptor
public long shutdown()
throws AdaptorException
shutdown in interface AdaptorAdaptorExceptionAdaptor.shutdown()
public void hardStop()
throws AdaptorException
hardStop in interface AdaptorAdaptorExceptionpublic 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 from
InterruptedExceptionpublic String getType()
getType in interface Adaptor
public String getCurrentStatus()
throws AdaptorException
Adaptor
getCurrentStatus in interface AdaptorAdaptorException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||