CompressedVectorReader Class Reference

An iterator object keeping track of a read in progress from a CompressedVectorNode. More...

Detailed Description

An iterator object keeping track of a read in progress from a CompressedVectorNode.

A CompressedVectorReader object is a block iterator that reads blocks of records from a CompressedVectorNode and stores them in memory buffers (SourceDestBuffers). Blocks of records are processed rather than a single record-at-a-time for efficiency reasons. The CompressedVectorReader class encapsulates all the state that must be saved in between the processing of one record block and the next (e.g. partially read disk pages, or data decompression state). New memory buffers can be used for each record block read, or the previous buffers can be reused.

CompressedVectorReader objects have an open/closed state. Initially a newly created CompressedVectorReader is in the open state. After the API user calls CompressedVectorReader::close, the object will be in the closed state and no more data transfers will be possible.

There is no CompressedVectorReader constructor in the API. The function CompressedVectorNode::reader returns an already constructed CompressedVectorReader object with given memory buffers (SourceDestBuffers) already associated.

It is recommended to call CompressedVectorReader::close to gracefully end the transfer. Unlike the CompressedVectorWriter, not all fields in the record of the CompressedVectorNode are required to be read at one time.

Class Invariant

A class invariant is a list of statements about an object that are always true before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks externally visible state for consistency and throws an exception if the invariant is violated:

See also
CompressedVectorNode, CompressedVectorWriter

The documentation for this class was generated from the following file: