|
VLink
2.0.0
A high-performance communication middleware
|
Abstract VLink bag recorder with split, compression, schema embedding and a global hook. 更多...
#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"#include "./bag_plugin_interface.h"类 | |
| class | vlink::BagWriter |
Asynchronous VLink message recorder built on top of MessageLoop. 更多... | |
| struct | vlink::BagWriter::Config |
| Recording behaviour, split policy and resource budgets. 更多... | |
命名空间 | |
| 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 non-blocking push() entry point that enqueues serialised messages onto a private MessageLoop, which then persists them through the concrete backend. 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.Writer state machine:
* async_run() push() flush()/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:
immediate writes.set_url_loss().push_schema() for offline introspection.VLINK_BAG_PATH environment variable.push() is thread-safe. immediate=true bypasses the queue and writes on the caller's thread; this should be reserved for finalisation or test code because it can block long enough to violate real-time deadlines.