|
VLink
2.1.0
A high-performance communication middleware
|
Abstract VLink bag recorder with split, compression, schema embedding and a global hook. More...
#include <chrono>#include <cstdint>#include <memory>#include <mutex>#include <string>#include <string_view>#include <unordered_map>#include <unordered_set>#include <vector>#include "../base/functional.h"#include "../base/macros.h"#include "../base/message_loop.h"#include "../impl/types.h"Go to the source code of this file.
Classes | |
| class | vlink::BagWriter |
Asynchronous VLink message recorder built on top of MessageLoop. More... | |
| struct | vlink::BagWriter::Config |
| Recording behaviour, split policy and resource budgets. More... | |
Namespaces | |
| vlink | |
Abstract VLink bag recorder with split, compression, schema embedding and a global hook.
BagWriter is the polymorphic base for VLink offline recording. It exposes a push() entry point, which either enqueues serialised messages onto a private MessageLoop or persists them synchronously according to Config::sync_mode. Two backends ship with VLink:
VDBWriter for SQLite-backed .vdb / .vdbx containers; default codec is LZAV for kCompressAuto and kCompressLzav selectors.VCAPWriter for MCAP-format .vcap / .vcapx containers; kCompressAuto and kCompressZstd select Zstandard when Zstd support is compiled in.Default asynchronous writer state machine:
* async_run() push() close()/dtor * +---------+ ----------> +-----------+ ---------> +---------+ ----------> +---------+ * | Open | | Running | <--------- | Pending | | Closed | * +---------+ +-----------+ ack +---------+ +---------+ * ^ ^ * | | * +--- split_by_size / split_by_time -- rotate --+ *
On-disk layout produced by the writers:
* +---------+----------------+---------------+----------------+--------+ * | Header | URL index | Schema index | Message stream | Footer | * +---------+----------------+---------------+----------------+--------+ * tag url_metas schema_data payloads finalisation * app * timezone *
Feature highlights:
Config::sync_mode.set_url_loss().push_schema() for offline introspection.VLINK_BAG_PATH environment variable.push() is thread-safe. Config::sync_mode selects synchronous writes for the writer's entire lifetime; otherwise writes are queued on the recording loop.