Documentation
¶
Overview ¶
Package aggregate provides private, bounded resident storage for capture state.
Index ¶
- Constants
- type Health
- type Row
- type Store
- type Tx
- func (t *Tx) Count(prefix string) (int64, error)
- func (t *Tx) Delete(prefix string) error
- func (t *Tx) DeleteKey(key string) error
- func (t *Tx) Each(prefix string, fn func(string, []byte) error) error
- func (t *Tx) EachStable(prefix string, fn func(string, []byte) error) error
- func (t *Tx) Find(prefix, upper string, descending bool) (string, []byte, bool, error)
- func (t *Tx) Get(key string) ([]byte, bool, error)
- func (t *Tx) Last(prefix string) (string, []byte, bool, error)
- func (t *Tx) Next(prefix, after string) (string, []byte, bool, error)
- func (t *Tx) NextBatch(prefix, after string) ([]Row, error)
- func (t *Tx) Put(key string, value []byte) error
Constants ¶
const BatchBytes = 256 << 10
const BatchRows = 32
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct {
LimitBytes int64 `json:"limitBytes"`
ResidentBytes int64 `json:"residentBytes"`
PeakBytes int64 `json:"peakBytes"`
DiskReads uint64 `json:"diskReads"`
DiskWrites uint64 `json:"diskWrites"`
Evictions uint64 `json:"evictions"`
DatabaseBytes int64 `json:"databaseBytes"`
PreparedStatements uint64 `json:"preparedStatements"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns an ephemeral SQLite file. ResidentBytes charges encoded values, keys and 256 bytes per LRU entry; SQLite has a separate 1 MiB page cache. A caller's decoded record and serialization scratch are outside this cache.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is valid only inside Do's callback. Callbacks must not call Store methods.
func (*Tx) Each ¶
Each visits an ordered range with one row resident at a time. The callback may replace the same key; it must not add keys to the range being visited.
func (*Tx) EachStable ¶ added in v0.16.9
EachStable batches a range whose membership and future rows do not change. The callback may rewrite its current row; SQL cursors close before callbacks.
func (*Tx) Find ¶
Find selects the nearest key in prefix's range, optionally bounded above. It merges dirty cache entries with persisted rows without flushing the cache.
func (*Tx) Next ¶
Next returns one ordered row after flushing pending writes. An empty after starts at prefix. Callers can release Do's lock between successive records.