Documentation
¶
Overview ¶
Package chunkcatalog implements a bounded LRU recording chunks known to be present in the CacheStore. Pure hot-path optimization; CacheStore is the source of truth.
The catalog is presence-only: it tracks whether a chunk's path is known to exist in the cachestore. No size or metadata is stored. chunk.Path encodes (origin_id, bucket, key, etag, chunk_size), so a path hit means the cachestore contains bytes for this exact version of this chunk - the path encoding IS the integrity statement, and a stale entry whose backing bytes have been deleted is self-healing (cachestore.GetChunk returns ErrNotFound, caller Forget()s the entry and falls through to the stat path).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is a bounded LRU keyed on chunk.Key.Path().
func New ¶
New constructs a Catalog. The log is used at debug level for per-call hit / miss / record / forget / evict trace lines via slog.LogAttrs so the cost when filtered out (operator runs at info or higher) is just the handler's level check. Passing nil falls back to slog.Default().
func (*Catalog) Lookup ¶
Lookup reports whether the chunk is known to be present in the cachestore. Bumps the LRU position on hit.
This is the hottest log site in orca: it fires on every chunk read attempt. The LogAttrs path ensures attribute-evaluation cost is zero when the configured level is above Debug.
func (*Catalog) Record ¶
Record marks the chunk as present.
The catalog is presence-only: callers do not pass (and the catalog does not store) any size or freshness metadata. chunk.Path encodes (origin_id, bucket, key, etag, chunk_size), so a Recorded key is sufficient to know which exact version is in the cachestore. See the package docstring for the rationale.