zerodds-durability-store-file

Services — Durability. Storage adapter with one file per sample for PERSISTENT durability; implements DurabilityStore from zerodds-durability-store (ADR 0009).

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 .bin file 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.
  • .unregistered holds the time of unregistration as Unix nanoseconds in ASCII.
  • .meta holds the TopicMeta of 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 .meta still opens; topic_meta then returns None.
  • Retention follows the Contract of the topic.

Consumers

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; implementiert DurabilityStore aus zerodds-durability-store (ADR 0009).

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.
  • .unregistered enthält den Zeitpunkt der Abmeldung als Unix-Nanosekunden in ASCII.
  • .meta enthält die TopicMeta des 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 .meta lässt sich weiterhin öffnen; topic_meta liefert dann None.
  • Die Aufbewahrung folgt dem Contract des Topics.

Konsumenten

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.