package octez-l2-libs
An indexed file (i.e. a file and an index) mapping keys to values. Contrary to INDEXABLE_STORE
, the values can vary in size. Internally, values are stored, concatenated, in a append only file. The index file associates keys to offsets in this file (and a header to retrieve information more efficiently).
The type of headers stored in the index. The header can contain fixed size information that can be accessed more efficiently than the full value.
val mem : [> `Read ] t -> key -> bool Tezos_base.TzPervasives.tzresult Lwt.t
Returns true
if the key has a value associated in the store.
val header :
[> `Read ] t ->
key ->
header option Tezos_base.TzPervasives.tzresult Lwt.t
Returns the header for a key if it exists in the store.
Read a full value and header from the indexed file store.
val append :
?flush:bool ->
[> `Write ] t ->
key:key ->
header:header ->
value:value ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
Append a new binding to the indexed file store.
val load :
path:string ->
index_buffer_size:int ->
cache_size:int ->
'a Store_sigs.mode ->
'a t Tezos_base.TzPervasives.tzresult Lwt.t
Loads a new or existing indexed file store in the directory path
.
val close : _ t -> unit Tezos_base.TzPervasives.tzresult Lwt.t
Close the index and the file. One must call load
again to read or write data in the store.
val gc :
?async:bool ->
Store_sigs.rw t ->
(key, value * header) gc_iterator ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
gc ?async t iter
garbage collects data stored in the store t
by keeping only the ones reachable by iter
. This call runs the GC asynchronously unless async
is false
. If a GC is already ongoing this new request is ignored and this call is a no-op.
wait_gc_completion t
returns a blocking thread if a GC run is currently ongoing.
val is_gc_finished : 'a t -> bool
is_gc_finished t
returns true
if there is no GC running.