Rust NIF WAL I/O module for ra_log_wal.
Replaces file:write and file:datasync with a Rust background thread that handles O_DIRECT, commit_delay batching, and fdatasync.
All NIF functions run on normal BEAM schedulers (<1μs each). The blocking I/O runs on a dedicated Rust OS thread.
This module is registered as an Erlang atom :ferricstore_wal_nif
so ra_log_wal can call it as IoMod:write(Handle, Data).
Summary
Functions
Close the WAL file. Blocks until drain + sync + close.
Open a WAL file. Spawns background I/O thread.
Returns current logical file size in bytes.
Read bytes from WAL at offset. Used during recovery.
Request async fdatasync. Sends {wal_sync_complete, Ref} on completion.
Write pre-formatted iodata to the WAL buffer. Does NOT write to disk.
Functions
Close the WAL file. Blocks until drain + sync + close.
Open a WAL file. Spawns background I/O thread.
Returns current logical file size in bytes.
Read bytes from WAL at offset. Used during recovery.
Request async fdatasync. Sends {wal_sync_complete, Ref} on completion.
Write pre-formatted iodata to the WAL buffer. Does NOT write to disk.