zerodds-durability-store-file
Services — Durability. Storage adapter with one file per sample for
PERSISTENTdurability; implementsDurabilityStorefromzerodds-durability-store(ADR 0009).
- Source: crates/durability-store-file
- API docs: docs.rs/zerodds-durability-store-file
zerodds-durability-store-file stores each sample as one file in a directory
tree. FileStore::open(root, default_contract) opens the store at
root and creates the directory if it does not exist. The crate has no
dependencies outside the workspace; it uses only zerodds-durability-store and
zerodds-qos.
<root>/<hex(topic)>/<hex(instance_key)>/<sequence>.bin
<root>/<hex(topic)>/<hex(instance_key)>/.unregistered
<root>/<hex(topic)>/.meta
- Topic name and instance key are hex-encoded, so the mapping is lossless and safe for the file system.
- Each
.binfile starts with a 34-byte header: creation time (8 bytes, nanoseconds, little-endian), XCDR representation (1 byte), big-endian flag (1 byte), GUID of the source writer (16 bytes), sequence number of the source writer (8 bytes, little-endian). The payload follows. Files with the earlier 10-byte header are not read back. .unregisteredholds the time of unregistration as Unix nanoseconds in ASCII..metaholds theTopicMetaof the topic (type name, keyedness, contract) in a fixed binary layout, so a restarted daemon can serve the topic again without registering it first. A topic directory without.metastill opens;topic_metathen returnsNone.- Retention follows the
Contractof the topic.
Consumers
zerodds-durability-service-bin(always compiled in).zerodds-durability-service, as a dev-dependency for its tests.
Status
std,#![forbid(unsafe_code)]. Safety classification in the crate docs: STANDARD.- Library only, no binary, no cargo features.
- 9 test functions in
tests/file_store.rs.
zerodds-durability-store-file
Dienste — Durability. Speicheradapter mit einer Datei pro Sample für Durability
PERSISTENT; implementiertDurabilityStoreauszerodds-durability-store(ADR 0009).
- Quelle: crates/durability-store-file
- API-Docs: docs.rs/zerodds-durability-store-file
zerodds-durability-store-file legt jedes Sample als eigene Datei in einem
Verzeichnisbaum ab. FileStore::open(root, default_contract) öffnet den Speicher
unter root und legt das Verzeichnis an, falls es fehlt. Die Crate hat keine
Abhängigkeiten außerhalb des Workspace; sie verwendet nur
zerodds-durability-store und zerodds-qos.
<root>/<hex(topic)>/<hex(instance_key)>/<sequence>.bin
<root>/<hex(topic)>/<hex(instance_key)>/.unregistered
<root>/<hex(topic)>/.meta
- Topic-Name und Instanzschlüssel sind hexadezimal kodiert; die Abbildung ist damit verlustfrei und für das Dateisystem unbedenklich.
- Jede
.bin-Datei beginnt mit einem Kopf von 34 Byte: Erzeugungszeit (8 Byte, Nanosekunden, Little-Endian), XCDR-Repräsentation (1 Byte), Big-Endian-Kennung (1 Byte), GUID des Quell-Writers (16 Byte), Sequenznummer des Quell-Writers (8 Byte, Little-Endian). Danach folgen die Nutzdaten. Dateien mit dem früheren Kopf von 10 Byte werden nicht zurückgelesen. .unregisteredenthält den Zeitpunkt der Abmeldung als Unix-Nanosekunden in ASCII..metaenthält dieTopicMetades Topics (Typname, Key-Eigenschaft, Vertrag) in einem festen Binärformat; ein neu gestarteter Daemon kann das Topic damit wieder bedienen, ohne es vorher zu registrieren. Ein Topic-Verzeichnis ohne.metalässt sich weiterhin öffnen;topic_metaliefert dannNone.- Die Aufbewahrung folgt dem
Contractdes Topics.
Konsumenten
zerodds-durability-service-bin(immer einkompiliert).zerodds-durability-service, als Dev-Abhängigkeit für die Tests.
Status
std,#![forbid(unsafe_code)]. Einstufung in der Crate-Dokumentation (safety classification): STANDARD.- Nur Bibliothek, kein Binary, keine Cargo-Features.
- 9 Testfunktionen in
tests/file_store.rs.