Module Tjr_lru_cache__Im_intf.Lru_entry

type 'v lru_entry =
| Insert of {
value : 'v;
dirty : bool;
}
| Delete of {
dirty : bool;
}
| Lower of 'v option

Cache map entries; values in the map are tagged with a last-accessed time (via underlying Lru impl) and a dirty flag

Entries in the cache for key k:

  • (Insert v (dirty=true/false)), this occurs on insert
  • (Delete (dirty=true/false))
  • (Lower vopt), this occurs when we check the lower layer for a non-existing entry in cache; if we find a value, we insert Lower (Some v), else Lower None; in either case, there is no need to do anything further (ie the entry is not dirty)
  • (No entry), for a key that hasn't been seen before
val is_Lower : 'a lru_entry -> bool
val mark_clean : 'a lru_entry -> 'a lru_entry
val entry_is_dirty : 'a lru_entry -> bool
val dirty_entry_to_kvop : 'a -> 'b lru_entry -> ('a'b) Tjr_fs_shared.Kvop.kvop