How rh211-sys/hashi-db works
This is an asynchronous, file-backed memo database. Callers use Controller to add, query, modify, and delete typed values; Cache handles in-memory lookup, expiry, eviction, and dirty state, while Disk provides persistence and compaction. TaskThreads supplies the read, write, and disk execution lanes. The type registry connects user-defined values to cereal binary serialization. The graph reflects documented APIs and visible dependency wiring; several detailed disk and cache behaviors are described in excerpts but their full implementations were not sampled.
Main entry points: controller.cpp Controller · cache.cpp Cache Operations · disk.cpp Disk Storage · data_type.h Value Types
Components 11
Database API
- Controller
project/data_memo_level/controller/controller.cpp
Cache Management
- Cache Operations
project/data_memo_level/cache/cache.cpp - Cache State
project/data_memo_level/cache/cache.h - Write-Pref Lock
project/data_memo_level/common/writePrefMutex.cpp
Persistence
- Disk Storage
project/data_memo_level/disk/disk.cpp - Disk Index
project/data_memo_level/disk/disk.h
Async Runtime
- Task Threads
project/data_memo_level/controller/taskThreads.h
Types and Serialization
- Value Types
project/data_memo_level/data_type.h - Result Codes
project/data_memo_level/protocol.h - Binary Archives
project/third_party_lib/cereal_lib/include/cereal/archives/binary.hpp
Other components
- Application
Connections 13
- Application → Controller: calls API
- Controller → Cache Operations: delegates operations
project/data_memo_level/controller/controller.cpp - Controller → Disk Storage: flushes data
project/data_memo_level/controller/controller.cpp - Controller → Task Threads: submits flush
project/data_memo_level/controller/controller.cpp - Controller → Cache State: binds dependencies
project/data_memo_level/controller/controller.cpp - Controller → Disk Storage: sets cache link
project/data_memo_level/controller/controller.cpp - Cache Operations → Cache State: updates state
project/data_memo_level/cache/cache.h - Cache Operations → Disk Storage: checks disk index
- Cache Operations → Task Threads: dispatches tasks
- Cache Operations → Write-Pref Lock: synchronizes access
- Disk Storage → Disk Index: maintains index
project/data_memo_level/disk/disk.h - Value Types → Result Codes: uses codes
project/data_memo_level/data_type.h - Value Types → Binary Archives: serializes values
project/data_memo_level/data_type.h