Module Make_1.With_bucket

Parameters

Signature

val len_sorted : unit -> int
val set_len_sorted : int -> unit
val len_unsorted : unit -> int
val set_len_unsorted : int -> unit
val sorted : Kv_hash__.Util.int_bigarray
val unsorted : Kv_hash__.Util.int_bigarray
module U : sig ... end
module S : sig ... end
val find_sorted : int -> int option
val find_unsorted : int -> int option

Just scan through unsorted, newest elts first

val find : int -> int option
val unsorted_to_sorted : (Kv_hash__.Util.Map_i.key * int) list -> (Kv_hash__.Util.Map_i.key * int) array
val merge_unsorted : unit -> unit

merge unsorted into sorted; NOTE assumes there is enough space to insert

val sorted_to_map : unit -> int Kv_hash__.Util.Map_i.t
val unsorted_to_map : int Kv_hash__.Util.Map_i.t -> int Kv_hash__.Util.Map_i.t
val split_with_addition : (Kv_hash__.Util.Map_i.key * int) -> (Kv_hash__.Util.Map_i.key * int) Base.List.t * Kv_hash__.Util.Map_i.key * (Kv_hash__.Util.Map_i.key * int) Base.List.t

The kv parameter is an extra key-value that we need to add to the split. Return value is a triple (kvs1,k,kvs2) where kvs1 < k <= kvs2, and |kvs1|,|kvs2| < max_sorted, and kvs1 and kvs2 are sorted i.e. safe to construct a new bucket for kvs1 and kvs2, separated by k

val add : Kv_hash__.Util.Map_i.key -> Kv_hash__.Util.Map_i.key -> [> `Ok | `Split of (Kv_hash__.Util.Map_i.key * Kv_hash__.Util.Map_i.key) Base.List.t * Kv_hash__.Util.Map_i.key * (Kv_hash__.Util.Map_i.key * Kv_hash__.Util.Map_i.key) Base.List.t ]
val init_sorted : (int * int) list -> unit
val export : unit -> Kv_hash.Bucket_intf.exported_bucket