org.apache.hadoop.chukwa.datacollection.adaptor
Class FileAdaptor
java.lang.Object
org.apache.hadoop.chukwa.datacollection.adaptor.AbstractAdaptor
org.apache.hadoop.chukwa.datacollection.adaptor.FileAdaptor
- All Implemented Interfaces:
- Adaptor
public class FileAdaptor
- extends AbstractAdaptor
File Adaptor push small size file in one chunk to collector
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
finished
protected volatile boolean finished
reader
protected RandomAccessFile reader
fileReadOffset
protected long fileReadOffset
shutdownCalled
protected boolean shutdownCalled
FileAdaptor
public FileAdaptor()
start
public void start(long bytes)
- Specified by:
start
in class AbstractAdaptor
shutdown
public long shutdown(AdaptorShutdownPolicy shutdownPolicy)
- Description copied from interface:
Adaptor
- Signals this adaptor to come to an orderly stop. The adaptor ought to push
out all the data it can before exiting depending of the shutdown policy
- Returns:
- the logical offset at which the adaptor was when the method return
parseArgs
public String parseArgs(String params)
- Specified by:
parseArgs
in class AbstractAdaptor
extractRecords
protected int extractRecords(ChunkReceiver eq,
long buffOffsetInFile,
byte[] buf,
long fileTime)
throws InterruptedException
- Extract records from a byte sequence
- Parameters:
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
- Returns:
- the number of bytes processed
- Throws:
InterruptedException
getCurrentStatus
public String getCurrentStatus()
- Description copied from interface:
Adaptor
- Return the adaptor's state Should not include class name or byte
offset, which are written by caller. The datatype should, however,
be written by this method.
- Returns:
- the adaptor state as a string
Copyright © ${year} The Apache Software Foundation