Internal.IndexAn abstraction on top of the index library that exposes an API that better fits the brassaia-pack use case.
type key = hashtype value = Optint.Int63.t * int * Brassaia_pack.Pack_value.Kind.tinclude Brassaia_index.Index.S
with type value := value
and type t := t
and type key := keyval empty_cache : unit -> cacheConstruct a new empty cache of index instances.
val v :
?flush_callback:(unit -> unit) ->
?cache:cache ->
?fresh:bool ->
?readonly:bool ->
?throttle:[ `Overcommit_memory | `Block_writes ] ->
?lru_size:int ->
log_size:int ->
string ->
tThe constructor for indexes.
This can be used to ensure certain pre-conditions are met before bindings are persisted to disk. (For instance, if the index bindings are pointers into another data-structure d, it may be necessary to flush d first to avoid creating dangling pointers.)
val clear : t -> unitclear t clears t so that there are no more bindings in it.
replace t k v binds k to v in t, replacing any existing binding of k.
If overcommit is true, the operation does not triger a merge, even if the caches are full. By default overcommit is false.
val sync : t -> unitsync t syncs a read-only index with the files on disk. Raises RW_not_allowed if called by a read-write index.
val is_merging : t -> boolis_merging t returns true if t is running a merge. Raises RO_not_allowed if called by a read-only index.
module Checks : sig ... endOffline fsck-like utility for checking the integrity of Index stores built using this module.
module Io = Brassaia_pack_unix.Io.Unixval init_exn :
?flush_callback:(unit -> unit) ->
?fresh:bool ->
?readonly:bool ->
?throttle:[ `Block_writes | `Overcommit_memory ] ->
?lru_size:int ->
log_size:int ->
string ->
tval init :
?flush_callback:(unit -> unit) ->
?fresh:bool ->
?readonly:bool ->
?throttle:[ `Block_writes | `Overcommit_memory ] ->
?lru_size:int ->
log_size:int ->
string ->
(t, [> create_error ]) Stdlib.resultval reload : t -> (unit, [> write_error ]) Stdlib.resultval close : t -> (unit, [> write_error ]) Stdlib.resultval close_exn : t -> unitval flush : t -> with_fsync:bool -> (unit, [> write_error ]) Stdlib.resultval merge : t -> unitval try_merge : t -> unitmodule Stats = Brassaia_index.Index.Statsmodule Key : Brassaia_index.Index.Key.S with type t = key