VLink  2.0.0
A high-performance communication middleware
vdb_reader.h File Reference

SQLite-backed playback for VLink .vdb / .vdbx bag files. More...

#include <future>
#include <memory>
#include <string>
#include <vector>
#include "./bag_reader.h"
Include dependency graph for vdb_reader.h:

Go to the source code of this file.

Classes

class  vlink::VDBReader
 Concrete SQLite-backed BagReader implementation with full random-access support. More...
 

Namespaces

 

Detailed Description

SQLite-backed playback for VLink .vdb / .vdbx bag files.

VDBReader is the concrete BagReader implementation for the SQLite container that VLink uses for recordings that require true random-access indexing, in-place repair, and tag-based navigation. Splits are described by a .vdbx JSON manifest pointing at one or more sibling .vdb files; this reader follows the manifest transparently.

VDB schema
Table Key columns Purpose
messages id, url_id, ts_us, action, data recorded payloads ordered by timestamp
urls id, url, ser_type, schema_type per-topic identity dictionary
schemas id, ser_type, schema_type, blob embedded schema descriptors
metadata key, value tag name, version, capture machine, etc.
stats url_id, count, bytes, loss per-URL aggregate counters
index ts_us, message_id timestamp -> message random-access index
Reader states
+---------+ play() +---------+ pause() +---------+
| stopped | ---------------> | playing | ---------------> | paused |
+---------+ +---------+ +---------+
^ | ^ |
| | | resume() / pause_to_next()|
+--- stop() / EOF -----------+ +--------------------------+
|
| jump(time, rate, times)
v
+---------+
| seeking | SQL index lookup
+---------+
Example
auto reader = vlink::BagReader::create("/data/recording.vdb");
reader->register_output_callback([](const vlink::Frame& frame) {
dispatch(frame.url, frame.data);
});
reader->async_run();
reader->play({});
See also
BagReader, VCAPReader