Expand description
On-disk cache-entry layout per CACHE-010, CACHE-012, and
CACHE-013.
Pure path-computation helpers. None of these functions touch
the filesystem; they translate a workspace-root path and a
CacheKey into the canonical paths the cache uses to read
and write entry data.
Layout tree under <workspace-root>/.haz/cache/:
.haz/cache/
`-- <shard>/ (first two hex chars of key)
`-- <hex-key>/ (entry directory)
|-- manifest.json (CACHE-011)
|-- stdout (CACHE-012)
|-- stderr (CACHE-012)
`-- outputs/
`-- <hex-content-hash> (CACHE-013, one per blob)Constants§
- MANIFEST_
FILE_ NAME - File name of the manifest within an entry directory
(
CACHE-011). - OUTPUTS_
SUBDIR - Subdirectory holding output blobs within an entry directory
(
CACHE-013). - STDERR_
FILE_ NAME - File name of the captured stderr stream within an entry
directory (
CACHE-012). - STDOUT_
FILE_ NAME - File name of the captured stdout stream within an entry
directory (
CACHE-012).
Functions§
- cache_
root - Compute the cache root directory under
workspace_root:<workspace_root>/.haz/cache. - entry_
dir - Entry directory of
key:<cache_root>/<shard>/<hex-key>. - manifest_
path - Path to the manifest file of
key’s entry. - output_
blob_ path - Path to a single output blob, keyed by its content hash
(
CACHE-013). - outputs_
dir - Subdirectory holding output blobs of
key’s entry. - restore_
staging_ dir - Staging directory used by restoration (
CACHE-019,CACHE-020): blob bytes are written here first, then renamed onto their workspace-absolute targets so a partial publish is detectable and contained. - shard
- The shard component of
keyperCACHE-010: the first two lowercase hexadecimal characters of the key. - shard_
dir - Shard directory under
cache_root:<cache_root>/<shard>. - stderr_
path - Path to the captured stderr file of
key’s entry. - stdout_
path - Path to the captured stdout file of
key’s entry. - tmp_
entry_ dir - The name of the two-phase-store tmp directory for
keywith the caller-suppliedrandom_suffix, perCACHE-017:.tmp-<hex-key>-<random>. The caller chooses the random suffix; the layout helper only joins it into the canonical shape so concurrent stores of the same key on the same shard do not collide.