Module Kv_hash__Nv_map_ii.Make_1

Parameters

Signature

type raw_bucket = Bucket_store.raw_bucket
type k = int
type v = int
val initial_partitioning : alloc:(unit -> Partition_.r) -> n:int -> Partition_.t

Create an initial n-way partition, with values provided by alloc

type t = {
bucket_store : Bucket_store.t;
mutable freelist : Kv_hash.Freelist.t;
mutable partition : Partition_.t;
}
val alloc : t -> int
val create_p : buckets_fn:string -> partition:Partition_.t -> min_free_blk:int -> t
val create_n : buckets_fn:string -> n:int -> t
val create : buckets_fn:string -> t
val close : t -> unit
val open_ : fn:'a -> n:'b -> 'c
val find_bucket : t -> Partition_.k -> Partition_.k * Partition_.r * Bucket_store.bucket

Public interface: insert, find (FIXME delete)

val insert : t -> Partition_.k -> int -> unit

NOTE the insert function is only called in the merge process

val find_opt : t -> Partition_.k -> int option
val get_freelist : t -> Kv_hash.Freelist.t

Debugging

val export : t -> Kv_hash.Nv_map_ii_intf.export_t
val show : t -> unit
val get_partition : t -> Partition_.t
val show_bucket : t -> Partition_.k -> unit
val get_bucket : t -> Partition_.k -> Bucket_store.raw_bucket