Documentation
¶
Overview ¶
Package querycache is the engine's query cache, as a platform embedding the engine provides it: the cache it sets on an Invocation (Cache), the store that keeps its metadata (Store, checked by engine/querycachetest), and what they deal in. Each name is an alias of the engine's own, so a value passes between the two unchanged. See docs/designs/query-cache.md.
A platform turns the cache off for an invocation by setting no Cache on it.
Index ¶
- Constants
- Variables
- func ValidNamespace(ns string) bool
- type Cache
- type Config
- type Contents
- type Entry
- type EntryID
- type Expired
- type Key
- type KeyInput
- type Lake
- type Manager
- type Settings
- type State
- type Store
- type StoreContents
- type Summarizer
- type Summary
- type Swept
- type Tag
- type TagKind
- type Write
Constants ¶
const ( Ready = cache.StateReady Incompatible = cache.StateIncompatible Disabled = cache.StateDisabled )
The cache's states.
const ( TagDataSource = cache.TagDataSource TagDataset = cache.TagDataset TagModel = cache.TagModel )
The kinds of Tag: what a query read, which a clean selects its entries by.
const DefaultReadGrace = cache.DefaultReadGrace
DefaultReadGrace is how long after an entry expires a Manager keeps its file, unless its Config says otherwise: the longest a read of it can run, and a margin. A platform sweeping its store across tenants removes no entry expired for less.
const MaxDuration = cache.MaxDuration
MaxDuration is the longest a query may ask the cache to keep its result, and accept a cached one for.
Variables ¶
var ( // ErrNotPending is a Store's refusal to commit or abandon a write that // isn't pending. ErrNotPending = cache.ErrNotPending // ErrNoDataSourceIdentity is NewKey's refusal of a data source the host // gave no identity (DataSource.Identity): its queries run uncached. ErrNoDataSourceIdentity = cache.ErrNoDataSourceIdentity )
Functions ¶
func ValidNamespace ¶
ValidNamespace reports whether ns can prefix a file's name in canal-lake.
Types ¶
type Cache ¶
type Cache = command.QueryCache
Cache is an invocation's query cache, set on an Invocation as QueryCache: its state for status, its settings, and its manager for a query. Nil: every query runs uncached, and status says nothing of one.
type Contents ¶
type Contents = command.QueryCacheContents
Contents are what the cache holds, and where, as Cache.Contents answers for cache.status.
type Lake ¶
Lake is what a Manager needs of canal-lake besides reading and writing entries: dropping their files.
type Manager ¶
Manager is the cache's algorithm over a Store: lookups, writes, cleaning and sweeping. Cache.Manager gives one, made by NewManager.
func NewManager ¶
NewManager makes a Manager over c's store.
type Settings ¶
type Settings = command.QueryCacheSettings
Settings are the cache's rules for a repo. A query's default cache.duration is the Invocation's QueryDefaults.CacheDuration.
type Store ¶
Store keeps the cache's metadata. A platform may implement it on its own database; engine/querycachetest is what it must pass.
type StoreContents ¶
StoreContents are what a store holds at a time: Contents without where.
type Summarizer ¶
type Summarizer = cache.Summarizer
Summarizer reports the cache's state, as status does.