Module Frontend.Writer_1

The writer is responsible for taking updates and recording in log, and periodically rotating logs and firing the merge process.

module F = Control_fields
type check_merge_t = {
pid : int;
gen : int;
}
type t = {
max_log_len : int;
ctl : Control.t;
mutable prev_map : (KV.k[ `Insert of KV.v | `Delete ]) Stdlib.Hashtbl.t;
mutable gen : int;
mutable curr_log : Log_file_w.t;
mutable curr_map : (KV.k[ `Insert of KV.v | `Delete ]) Stdlib.Hashtbl.t;
mutable check_merge : check_merge_t option;
mutable nv_map_ss : Nv_map_ss_.t;
lru_ss : Kv_hash__.Util.Lru_ss.t;
debug : (KV.kKV.v) Stdlib.Hashtbl.t;
debug_log : Stdlib.out_channel;
}

check_merge: whether we need to check the old merge has completed before launching a new one; the int is the pid

lru_ss: an Lru that sits behind the logs but in front of nv_map_ss

val create : ?⁠max_log_len:int -> ?⁠ctl_fn:string -> ?⁠buckets_fn:string -> ?⁠values_fn:string -> unit -> t
val open_ : ?⁠max_log_len:int -> ?⁠ctl_fn:string -> ?⁠buckets_fn:string -> ?⁠values_fn:string -> unit -> unit
val switch_logs : t -> unit
val find_opt : t -> KV.k -> KV.v option
val insert : t -> KV.k -> KV.v -> unit
val delete : 'a -> 'b -> 'c
val close : t -> unit
module With_debug : functor () sig ... end

Debugging versions