Avro C++
|
The type independent portion of reader. More...
#include <DataFile.hh>
Public Member Functions | |
Decoder & | decoder () |
Returns the current decoder for this reader. | |
bool | hasMore () |
Returns true if and only if there is more to read. | |
void | decr () |
Decrements the number of objects yet to read. | |
DataFileReaderBase (const char *filename) | |
Constructs the reader for the given file and the reader is expected to use the schema that is used with data. More... | |
DataFileReaderBase (std::unique_ptr< InputStream > inputStream) | |
void | init () |
Initializes the reader so that the reader and writer schemas are the same. | |
void | init (const ValidSchema &readerSchema) |
Initializes the reader to read objects according to the given schema. More... | |
const ValidSchema & | readerSchema () |
Returns the schema for this object. | |
const ValidSchema & | dataSchema () |
Returns the schema stored with the data file. | |
void | close () |
Closes the reader. More... | |
void | seek (int64_t position) |
Move to a specific, known synchronization point, for example one returned from tell() after sync(). | |
void | sync (int64_t position) |
Move to the next synchronization point after a position. More... | |
bool | pastSync (int64_t position) |
Return true if past the next synchronization point after a position. | |
int64_t | previousSync () const |
Return the last synchronization point before our current position. | |
The type independent portion of reader.
|
explicit |
Constructs the reader for the given file and the reader is expected to use the schema that is used with data.
This function should be called exactly once after constructing the DataFileReaderBase object.
void avro::DataFileReaderBase::close | ( | ) |
Closes the reader.
No further operation is possible on this reader.
void avro::DataFileReaderBase::init | ( | const ValidSchema & | readerSchema | ) |
Initializes the reader to read objects according to the given schema.
This gives an opportunity for the reader to see the schema in the data file before deciding the right schema to use for reading. This must be called exactly once after constructing the DataFileReaderBase object.
void avro::DataFileReaderBase::sync | ( | int64_t | position | ) |
Move to the next synchronization point after a position.
To process a range of file entries, call this with the starting position, then check pastSync() with the end point before each use of decoder().