package plebeia

  1. Overview
  2. Docs
Functional storage using Merkle Patricia tree

Install

Dune Dependency

Authors

Maintainers

Sources

plebeia-2.2.0.tar.gz
md5=7191dbbd3057df0a78032b560039bb59
sha512=f09790dfa65a6c8dc0da9618123d93f145c16c3b5be719dad04114bbe95a7e94697cacf2c6fb5b50c14408f864954dbf8d47e5994093623eb77f488bdf5c4205

doc/plebeia/Plebeia/Node_cache/index.html

Module Plebeia.Node_cacheSource

Node hashconsing based on the hashes

It actually provides an on-memory cache map from Hash.t to Index.t

Sourcetype _ t

The cache table type

Sourcetype config = {
  1. threshold_at_shrink : int;
    (*

    Call of shrink triggers the wipe of unpopular data when the number of the items in the table exceeds this amount

    *)
  2. threshold_absolute : int;
    (*

    Call of add triggers the wipe of unpopular data when the number of the items in the table exceeds this amount

    *)
  3. shrink_ratio : float;
    (*

    How much data we keep for each wipe.

    *)
}
Sourcetype stat = {
  1. ever_hit : int;
  2. ever_added : int;
}
Sourceval config_enabled : config
Sourceval config_disabled : config
Sourceval get_stat : _ t -> stat
Sourceval create : config -> _ t

Create a new empty table with the shrink_size. May raise Invalid_arg

Sourceval pp_stat : Format.formatter -> _ t -> unit

Print out the stat

Sourceval find_opt : 'a t -> Hash.t -> 'a option
Sourceval add : 'a t -> Hash.t -> 'a -> unit
Sourceval size : _ t -> int

The number of the entries in the table.

Sourceval estimated_size_in_bytes : _ t -> int

Estimated table size in bytes.

This is for 28 byte Hash.t and 32 byte Index.t, where each element costs about 142 bytes.

It returns 99-101% of the real size.

Sourceval shrink : _ t -> unit

Shrink down the size of the table lower than threshold_commit.

OCaml

Innovation. Community. Security.