RaftEx.LogMeta
(raft_ex v0.1.0)
View Source
Durable metadata store for Raft servers: current_term, voted_for, and
last_applied.
Storage layout
Data is stored in a DETS file (meta.dets) and mirrored into an ETS table
for fast reads. Each row has the shape:
{uid, current_term, voted_for, last_applied}Writes go to both DETS and ETS immediately. Synchronous writes (store_sync
and delete_sync) additionally call :dets.sync/1 so the data is flushed
to disk before the call returns.
Concurrency model
All writes are serialised through this GenServer. Reads bypass the process and access ETS directly, making them safe to call from any process.
Summary
Functions
Returns a specification to start this module under a supervisor.
Asynchronously delete all metadata for uid.
Synchronously delete all metadata for uid, fsyncing DETS before returning.
Fetch a single metadata field, returning nil if absent.
Fetch a metadata field, returning default when absent.
Start the metadata store and link it into the supervision tree.
Asynchronously store {uid, key, value}.
Synchronously store {uid, key, value}, fsyncing DETS before returning.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Asynchronously delete all metadata for uid.
Synchronously delete all metadata for uid, fsyncing DETS before returning.
Fetch a single metadata field, returning nil if absent.
Fetch a metadata field, returning default when absent.
Start the metadata store and link it into the supervision tree.
Asynchronously store {uid, key, value}.
Synchronously store {uid, key, value}, fsyncing DETS before returning.