Skip to main content

Module cache

Module cache 

Source
Expand description

Cache management and memory-mapped I/O

The cache module handles the .reflex/ directory structure:

  • meta.db: Metadata, file fingerprints, dependencies and the symbol cache (SQLite)
  • content.bin: Memory-mapped file contents (binary)
  • trigrams.bin: Trigram inverted index (per-file varint blocks, V4 format)
  • config.toml: Index settings (TOML text)

Structs§

BranchInfo
Branch metadata information
CacheManager
Manages the Reflex cache directory
FileFingerprint
What freshness compares a file on disk against.
FileRow
One files row as the indexer writes it.
FileStat
Modification time as nanoseconds since the Unix epoch, 0 when unavailable. The size and mtime a walk records for a file: all that change detection and a stored fingerprint need (24 bytes, where a Metadata is ~150; a walk keeps one per file).
StatusReads
Result of CacheManager::status_reads.

Constants§

CACHE_DIR
Default cache directory name
CONFIG_TOML
HASHES_JSONDeprecated
LANGUAGES_OVERRIDE_KEY
statistics key: the --languages of the last rfx index run that passed one (JSON list). Older binaries ignore it.
META_DB
File names within the cache directory
TOKENS_BINDeprecated
WALK_SEQ_GAP
Spacing of files.walk_seq in a full build (position * WALK_SEQ_GAP), so a file added later can take a value between its neighbours without renumbering.

Functions§

mtime_ns
open_meta_db
Open a SQLite database with Reflex’s standard pragmas.
recorded_mtime_ns
The mtime to record for a file read during an index run that began at run_start.