Documentation
¶
Index ¶
- type Graveyard
- func (g *Graveyard) Add(seq uint64, pages []uint64)
- func (g *Graveyard) Extract(minPinnedSeq, currentSeq, keepRecent uint64) []uint64
- func (g *Graveyard) ExtractBatchesUpTo(minPinnedSeq, currentSeq, keepRecent uint64, maxIDs int) []RetiredBatch
- func (g *Graveyard) Reinsert(seq uint64, pages []uint64)
- type ReaderRegistry
- type RetiredBatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graveyard ¶
type Graveyard struct {
// contains filtered or unexported fields
}
func NewGraveyard ¶
func NewGraveyard() *Graveyard
func (*Graveyard) Extract ¶
Extract returns pages that are safe to free. Condition: seq < minPinnedSeq AND seq < (currentSeq - keepRecent).
func (*Graveyard) ExtractBatchesUpTo ¶
func (g *Graveyard) ExtractBatchesUpTo(minPinnedSeq, currentSeq, keepRecent uint64, maxIDs int) []RetiredBatch
ExtractBatchesUpTo returns up to maxIDs pages that are safe to free, grouped by retirement sequence so callers can reinsert on error.
Safe-to-free condition is the same as Extract:
- retiredAtSeq < minPinnedSeq
- retiredAtSeq < (currentSeq - keepRecent)
If maxIDs <= 0, all safe pages are returned.
type ReaderRegistry ¶
type ReaderRegistry struct {
// contains filtered or unexported fields
}
func NewReaderRegistry ¶
func NewReaderRegistry() *ReaderRegistry
func (*ReaderRegistry) MinPinnedSeq ¶
func (r *ReaderRegistry) MinPinnedSeq() uint64
MinPinnedSeq returns the lowest sequence number currently pinned by any reader. If no readers are active, returns MaxUint64 (meaning no restriction from readers).
func (*ReaderRegistry) Register ¶
func (r *ReaderRegistry) Register(seq uint64) int64
Register adds a reader pinned to the given sequence. Returns a handle to be used for Unregister.
func (*ReaderRegistry) Unregister ¶
func (r *ReaderRegistry) Unregister(id int64)
Unregister removes a reader.
type RetiredBatch ¶
RetiredBatch represents a set of pages retired at a specific commit sequence. It is returned by ExtractBatchesUpTo so callers can reinsert pages on failure.