Umbra::RepositoryReader class

Reading blobs.

Since the access to blob contents can be slow the user of this API should organize reading needs so that multiple read operations can run in parallel and only start reading data out of the streams once it is available.

A call to readBlob() prepares data of the blob to be read and is non-blocking. The only place where this API blocks is when reading the input stream of a blob before the data is available.

The proper way of doing reading is to issue as many readBlob() calls as possible (until you run out of things to read or ReadStatus_MaxParallelReads is returned), and using the returned "Ref" elements for getting access to the data via stream(). The implementation guarantees that reading the data in the same order that the readBlob() calls were issued never causes a deadlock and eventually all data is delivered for reading. For performance, however, it is better to process reads in the order returned by nextAvailable().

Constructors, destructors, conversion operators

~RepositoryReader() virtual

Public functions

auto getRoot() const -> BlobKey virtual
auto readBlob(const BlobKey& key, const char* suffix = nullptr) -> Ref pure virtual
auto stream(Ref r) -> InputStream& pure virtual
auto readDone(Ref r, char* errMsg = NULL, int errMsgLen = 0) -> bool pure virtual
auto nextAvailable() const -> Ref pure virtual