Apache Singa
A General Distributed Deep Learning Library
|
Binfilereader reads tuples from binary file with key-value pairs. More...
#include <reader.h>
Public Member Functions | |
bool | Open (const std::string &path) override |
bool | Open (const std::string &path, int capacity) |
user defines capacity More... | |
void | Close () override |
bool | Read (std::string *key, std::string *value) override |
int | Count () override |
void | SeekToFirst () override |
std::string | path () |
return path to binary file | |
Public Member Functions inherited from singa::io::Reader | |
virtual | ~Reader () |
In case that users forget to call Close() to release resources, e.g., memory, you can release them here. More... | |
Protected Member Functions | |
bool | OpenFile () |
Open a file with path_ and initialize buf_. | |
bool | ReadField (std::string *content) |
Read the next filed, including content_len and content; return true if succeed. More... | |
bool | PrepareNextField (int size) |
Read data from disk if the current data in the buffer is not a full field. More... | |
Binfilereader reads tuples from binary file with key-value pairs.
|
overridevirtual |
Implements singa::io::Reader.
|
overridevirtual |
Implements singa::io::Reader.
|
overridevirtual |
Implements singa::io::Reader.
bool singa::io::BinFileReader::Open | ( | const std::string & | path, |
int | capacity | ||
) |
user defines capacity
user defines capacity
|
protected |
Read data from disk if the current data in the buffer is not a full field.
size is the size of the next field.
|
overridevirtual |
Implements singa::io::Reader.
|
protected |
Read the next filed, including content_len and content; return true if succeed.
|
overridevirtual |
Implements singa::io::Reader.