Module Superbol_cache.Layout

Where things sit under the cache root.

Every path starts with the format version, so that instances built against another layout occupy a disjoint subtree of the same root and neither reads nor reclaims what it does not understand.

Manifests and values are spread over a level of two-hexadecimal-digit directories. A single flat directory of several thousand entries is slow to list on the network mounts this cache is expected to live on, and slow to look up in on file-systems without directory indexing.

val version_dir : string
val manifests : string
val objects : string
val lock : string
val tmp : string

Where a store stages an item before publishing it. Kept out of the fanout directories so that a half-written item is never mistaken for an entry, and within the format's own subtree so that it shares its file-system.

val fanout : string -> string

Two hexadecimal digits are enough to keep directories small at the scale a single machine reaches, and cheap to compute.

val manifest : string -> string
val object_ : Stdlib.Digest.t -> string
val is_version_dir : string -> bool

is_version_dir name holds of the top-level entries this library owns, so that the pruner can tell a sibling format's subtree from unrelated files a user may have left in the cache root.