public class AvroFileHdfsReader extends java.lang.Object implements SingleFileHdfsReader
| Modifier and Type | Class and Description |
|---|---|
static class |
AvroFileHdfsReader.AvroFileCheckpoint
An avro file looks something like this:
Byte offset: 0 103 271 391
┌────────┬──────────────┬───────────┬───────────┐
Avro file: │ Header │ Block 1 │ Block 2 │ Block 3 │ ...
|
| Constructor and Description |
|---|
AvroFileHdfsReader(org.apache.samza.system.SystemStreamPartition systemStreamPartition) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader.
|
boolean |
hasNext()
Whether there are still records to be read
|
java.lang.String |
nextOffset()
Get the next offset, which is the offset for the next message
that will be returned by readNext
|
static int |
offsetComparator(java.lang.String offset1,
java.lang.String offset2) |
void |
open(java.lang.String pathStr,
java.lang.String singleFileOffset)
Open the file and seek to specific offset for reading.
|
org.apache.samza.system.IncomingMessageEnvelope |
readNext()
Construct and return the next message envelope
|
void |
seek(java.lang.String singleFileOffset)
Seek to a specific offset
|
public AvroFileHdfsReader(org.apache.samza.system.SystemStreamPartition systemStreamPartition)
public void open(java.lang.String pathStr,
java.lang.String singleFileOffset)
SingleFileHdfsReaderopen in interface SingleFileHdfsReaderpathStr - path of the file to be readsingleFileOffset - offset the reader should start frompublic void seek(java.lang.String singleFileOffset)
SingleFileHdfsReaderseek in interface SingleFileHdfsReadersingleFileOffset - offset the reader should seek topublic org.apache.samza.system.IncomingMessageEnvelope readNext()
SingleFileHdfsReaderreadNext in interface SingleFileHdfsReaderpublic boolean hasNext()
SingleFileHdfsReaderhasNext in interface SingleFileHdfsReaderpublic void close()
SingleFileHdfsReaderclose in interface SingleFileHdfsReaderpublic java.lang.String nextOffset()
SingleFileHdfsReadernextOffset in interface SingleFileHdfsReaderpublic static int offsetComparator(java.lang.String offset1,
java.lang.String offset2)