Help us shape the future of Go! Take the 2026 Go Developer Survey

engine

package
v0.57.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatVersion identifies the immutable volume format. The volume runtime
	// frames each root with it, so a root written in another format opens as a
	// replacement instead of failing as corrupt.
	FormatVersion = 4

	// MaxValueBytes preserves the supported maximum block and metadata value.
	MaxValueBytes = 2 << 20
)

Variables

View Source
var (
	// ErrCorrupt reports an invalid committed file without resetting data.
	ErrCorrupt = errors.New("invalid immutable volume file")
	// ErrLimit reports an input exceeding a documented engine bound.
	ErrLimit = errors.New("immutable volume input exceeds limit")
	// ErrClosed reports work attempted after engine shutdown.
	ErrClosed = errors.New("immutable volume is closed")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Read returns an owned bounded range, or a complete file when length is readAll.
	Read(ctx context.Context, name string, offset int64, length int) ([]byte, error)
	// Write acknowledges durable replacement; interrupted first creation may leave an empty entry.
	Write(ctx context.Context, name string, data []byte) error
	// Remove deletes a file and succeeds when it is already absent.
	Remove(ctx context.Context, name string) error
	// Lock holds origin-wide shared or exclusive access until its release is called.
	Lock(ctx context.Context, name string, exclusive bool) (func(), error)
	// Subscribe registers a lossy publication hint; its release closes resources.
	Subscribe() (<-chan struct{}, func())
	// Notify announces a durable generation without affecting commit success.
	Notify(generation uint64)
	// Close releases instance-local notification resources.
	Close() error
}

Backend provides immutable files, atomic whole-file replacement, and locks. Lock names are local to one volume and shared by all of its runtime instances. Read returns io/fs.ErrNotExist for missing files. Write acknowledges only after durable whole-file publication. Remove is idempotent.

type BlockStore

type BlockStore struct {
	// contains filtered or unexported fields
}

BlockStore owns bounded local write admission and its durable pack store. A successful Sync covers every write admitted before that fence began.

func NewBlockStore

func NewBlockStore(ctx context.Context, e *Engine, hashType hash.HashType) *BlockStore

NewBlockStore starts bounded writeback and quiescent maintenance for a volume.

func (*BlockStore) BeginReadOperation

func (s *BlockStore) BeginReadOperation(ctx context.Context) (block.StoreOps, func(), error)

BeginReadOperation pins durable files and retains local pending read-through.

func (*BlockStore) Close

func (s *BlockStore) Close() error

Close cancels admission, joins writeback, and releases uncommitted local data.

func (*BlockStore) GetBlock

func (s *BlockStore) GetBlock(ctx context.Context, ref *block.BlockRef) ([]byte, bool, error)

GetBlock reads admitted content before consulting durable immutable packs.

func (*BlockStore) GetBlockExists

func (s *BlockStore) GetBlockExists(ctx context.Context, ref *block.BlockRef) (bool, error)

GetBlockExists answers from pending state or the small location index.

func (*BlockStore) GetBlockExistsBatch

func (s *BlockStore) GetBlockExistsBatch(ctx context.Context, refs []*block.BlockRef) ([]bool, error)

GetBlockExistsBatch shares one immutable generation for uncached references.

func (*BlockStore) GetHashType

func (s *BlockStore) GetHashType() hash.HashType

GetHashType returns the configured preferred hash without storage work.

func (*BlockStore) GetStoredBlock

func (s *BlockStore) GetStoredBlock(ctx context.Context, ref *block.BlockRef) (*block.StoredBlock, error)

GetStoredBlock serves the block without refs because this store keeps block bytes without their refs.

func (*BlockStore) GetSupportedFeatures

func (s *BlockStore) GetSupportedFeatures() block.StoreFeature

GetSupportedFeatures prevents redundant buffering above this volume.

func (*BlockStore) PutBlock

func (s *BlockStore) PutBlock(ctx context.Context, data []byte, opts *block.PutOpts) (*block.BlockRef, bool, error)

PutBlock admits verified content and optionally completes its durability fence.

func (*BlockStore) PutBlockBatch

func (s *BlockStore) PutBlockBatch(ctx context.Context, entries []*block.PutBatchEntry) error

PutBlockBatch validates supplied identities and admits the bounded local writes.

func (*BlockStore) RmBlock

func (s *BlockStore) RmBlock(ctx context.Context, ref *block.BlockRef) error

RmBlock orders deletion after prior local writes and durably records its extent.

func (*BlockStore) StatBlock

func (s *BlockStore) StatBlock(ctx context.Context, ref *block.BlockRef) (*block.BlockStat, error)

StatBlock returns pending or indexed payload length without reading payloads.

func (*BlockStore) Sync

func (s *BlockStore) Sync(ctx context.Context) (bool, error)

Sync publishes every write admitted before the captured sequence fence.

type Catalogue

type Catalogue struct {

	// Children route ordered key ranges when this is a branch page.
	Children []*Child `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"`
	// Partitions route ordered run ranges when this is a leaf page.
	Partitions []*Partition `protobuf:"bytes,2,rep,name=partitions,proto3" json:"partitions,omitempty"`
	// contains filtered or unexported fields
}

Catalogue contains either ordered children or ordered run partitions.

func (*Catalogue) CloneMessageVT

func (m *Catalogue) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Catalogue) CloneVT

func (m *Catalogue) CloneVT() *Catalogue

func (*Catalogue) EqualMessageVT

func (this *Catalogue) EqualMessageVT(thatMsg any) bool

func (*Catalogue) EqualVT

func (this *Catalogue) EqualVT(that *Catalogue) bool

func (*Catalogue) GetChildren

func (x *Catalogue) GetChildren() []*Child

func (*Catalogue) GetPartitions

func (x *Catalogue) GetPartitions() []*Partition

func (*Catalogue) MarshalJSON

func (x *Catalogue) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Catalogue to JSON.

func (*Catalogue) MarshalProtoJSON

func (x *Catalogue) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Catalogue message to JSON.

func (*Catalogue) MarshalProtoText

func (x *Catalogue) MarshalProtoText() string

func (*Catalogue) MarshalToSizedBufferVT

func (m *Catalogue) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Catalogue) MarshalToVT

func (m *Catalogue) MarshalToVT(dAtA []byte) (int, error)

func (*Catalogue) MarshalVT

func (m *Catalogue) MarshalVT() (dAtA []byte, err error)

func (*Catalogue) ProtoMessage

func (*Catalogue) ProtoMessage()

func (*Catalogue) Reset

func (x *Catalogue) Reset()

func (*Catalogue) SizeVT

func (m *Catalogue) SizeVT() (n int)

func (*Catalogue) String

func (x *Catalogue) String() string

func (*Catalogue) UnmarshalJSON

func (x *Catalogue) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Catalogue from JSON.

func (*Catalogue) UnmarshalProtoJSON

func (x *Catalogue) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Catalogue message from JSON.

func (*Catalogue) UnmarshalVT

func (m *Catalogue) UnmarshalVT(dAtA []byte) error

type Child

type Child struct {

	// Lower is the inclusive lower key bound of this range.
	Lower []byte `protobuf:"bytes,1,opt,name=lower,proto3" json:"lower,omitempty"`
	// File names the immutable child catalogue page.
	File string `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

Child routes keys beginning at lower to an immutable catalogue page.

func (*Child) CloneMessageVT

func (m *Child) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Child) CloneVT

func (m *Child) CloneVT() *Child

func (*Child) EqualMessageVT

func (this *Child) EqualMessageVT(thatMsg any) bool

func (*Child) EqualVT

func (this *Child) EqualVT(that *Child) bool

func (*Child) GetFile

func (x *Child) GetFile() string

func (*Child) GetLower

func (x *Child) GetLower() []byte

func (*Child) MarshalJSON

func (x *Child) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Child to JSON.

func (*Child) MarshalProtoJSON

func (x *Child) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Child message to JSON.

func (*Child) MarshalProtoText

func (x *Child) MarshalProtoText() string

func (*Child) MarshalToSizedBufferVT

func (m *Child) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Child) MarshalToVT

func (m *Child) MarshalToVT(dAtA []byte) (int, error)

func (*Child) MarshalVT

func (m *Child) MarshalVT() (dAtA []byte, err error)

func (*Child) ProtoMessage

func (*Child) ProtoMessage()

func (*Child) Reset

func (x *Child) Reset()

func (*Child) SizeVT

func (m *Child) SizeVT() (n int)

func (*Child) String

func (x *Child) String() string

func (*Child) UnmarshalJSON

func (x *Child) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Child from JSON.

func (*Child) UnmarshalProtoJSON

func (x *Child) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Child message from JSON.

func (*Child) UnmarshalVT

func (m *Child) UnmarshalVT(dAtA []byte) error

type Edge

type Edge struct {

	// Subject is the complete source node identity.
	Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	// Object is the complete target node identity.
	Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
	// contains filtered or unexported fields
}

Edge records complete source and target identities in the GC journal.

func (*Edge) CloneMessageVT

func (m *Edge) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Edge) CloneVT

func (m *Edge) CloneVT() *Edge

func (*Edge) EqualMessageVT

func (this *Edge) EqualMessageVT(thatMsg any) bool

func (*Edge) EqualVT

func (this *Edge) EqualVT(that *Edge) bool

func (*Edge) GetObject

func (x *Edge) GetObject() string

func (*Edge) GetSubject

func (x *Edge) GetSubject() string

func (*Edge) MarshalJSON

func (x *Edge) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Edge to JSON.

func (*Edge) MarshalProtoJSON

func (x *Edge) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Edge message to JSON.

func (*Edge) MarshalProtoText

func (x *Edge) MarshalProtoText() string

func (*Edge) MarshalToSizedBufferVT

func (m *Edge) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Edge) MarshalToVT

func (m *Edge) MarshalToVT(dAtA []byte) (int, error)

func (*Edge) MarshalVT

func (m *Edge) MarshalVT() (dAtA []byte, err error)

func (*Edge) ProtoMessage

func (*Edge) ProtoMessage()

func (*Edge) Reset

func (x *Edge) Reset()

func (*Edge) SizeVT

func (m *Edge) SizeVT() (n int)

func (*Edge) String

func (x *Edge) String() string

func (*Edge) UnmarshalJSON

func (x *Edge) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Edge from JSON.

func (*Edge) UnmarshalProtoJSON

func (x *Edge) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Edge message from JSON.

func (*Edge) UnmarshalVT

func (m *Edge) UnmarshalVT(dAtA []byte) error

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine owns one volume's durable publication, immutable reads, and cache. Instances coordinate through Backend locks; cached files never prove freshness.

func Open

func Open(ctx context.Context, backend Backend) (_ *Engine, retErr error)

Open validates the current root or creates an empty volume.

func (*Engine) AcquireSTW

func (e *Engine) AcquireSTW(ctx context.Context) (func(), error)

AcquireSTW excludes new journal appends during the collector's final sweep.

func (*Engine) Append

func (e *Engine) Append(ctx context.Context, adds, removes []block_gc.RefEdge) error

Append durably journals one ownership transition while sharing the GC barrier. Sequence allocation and the journal record publish in the same engine root.

func (*Engine) Apply

func (e *Engine) Apply(ctx context.Context, records []*Record) error

Apply atomically publishes sorted-record mutations in commit order.

func (*Engine) BlockStats

func (e *Engine) BlockStats(ctx context.Context) (uint64, uint64, error)

BlockStats returns committed block count and live payload bytes.

func (*Engine) CleanPack

func (e *Engine) CleanPack(ctx context.Context) (bool, error)

CleanPack relocates one oldest dirty pack and atomically advances its queue. Preparation does not hold the publication lock; each copied location is compared again before it can replace a current index entry.

func (*Engine) Close

func (e *Engine) Close() error

Close releases instance cache state and rejects subsequent operations.

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context) error

Execute satisfies the durable volume store lifecycle; writes are synchronous.

func (*Engine) Get

func (e *Engine) Get(ctx context.Context, key []byte) ([]byte, bool, uint64, error)

Get returns a caller-owned value and the generation that supplied it.

func (*Engine) GetPendingOutgoingRefs

func (e *Engine) GetPendingOutgoingRefs(ctx context.Context, node string) ([]string, error)

GetPendingOutgoingRefs scans the unreplayed journal in one snapshot for edges from node. Journal order applies each removal after earlier additions.

func (*Engine) Maintenance

func (e *Engine) Maintenance(ctx context.Context) error

Maintenance performs one bounded relocation and retirement quantum.

func (*Engine) MetadataStore

func (e *Engine) MetadataStore() kvtx.Store

MetadataStore exposes the public metadata namespace. Transactions validate only the ranges they read, so block and GC writes never invalidate them.

func (*Engine) NewTransaction

func (e *Engine) NewTransaction(ctx context.Context, write bool) (kvtx.Tx, error)

NewTransaction opens a lazy generation-consistent transaction.

func (*Engine) Reclaim

func (e *Engine) Reclaim(ctx context.Context) (bool, error)

Reclaim deletes a bounded batch of retired files, then checkpoints once. It never waits for readers while holding the publication lock.

func (*Engine) RefreshGenerationContext

func (e *Engine) RefreshGenerationContext(ctx context.Context) (uint64, error)

RefreshGenerationContext reads the durable generation under file protection.

func (*Engine) ReplayWAL

func (e *Engine) ReplayWAL(ctx context.Context, graph block_gc.CollectorGraph) (count int, err error)

ReplayWAL serializes ordered replay and removes each entry only after application. Repeating an entry after interruption is safe because graph updates are idempotent.

func (*Engine) WaitGeneration

func (e *Engine) WaitGeneration(ctx context.Context, after uint64) (uint64, error)

WaitGeneration waits for a durable generation newer than after. Broadcast hints only schedule reads. The bounded fallback recovers messages lost while a browser tab is suspended or its notification channel is absent.

type Files

type Files struct {

	// Names lists the bounded immutable files owned by this publication.
	Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	// Publication matches the committed root or its recoverable intent.
	Publication string `protobuf:"bytes,2,opt,name=publication,proto3" json:"publication,omitempty"`
	// contains filtered or unexported fields
}

Files records a bounded publication's allocated or retired immutable files.

func (*Files) CloneMessageVT

func (m *Files) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Files) CloneVT

func (m *Files) CloneVT() *Files

func (*Files) EqualMessageVT

func (this *Files) EqualMessageVT(thatMsg any) bool

func (*Files) EqualVT

func (this *Files) EqualVT(that *Files) bool

func (*Files) GetNames

func (x *Files) GetNames() []string

func (*Files) GetPublication

func (x *Files) GetPublication() string

func (*Files) MarshalJSON

func (x *Files) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Files to JSON.

func (*Files) MarshalProtoJSON

func (x *Files) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Files message to JSON.

func (*Files) MarshalProtoText

func (x *Files) MarshalProtoText() string

func (*Files) MarshalToSizedBufferVT

func (m *Files) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Files) MarshalToVT

func (m *Files) MarshalToVT(dAtA []byte) (int, error)

func (*Files) MarshalVT

func (m *Files) MarshalVT() (dAtA []byte, err error)

func (*Files) ProtoMessage

func (*Files) ProtoMessage()

func (*Files) Reset

func (x *Files) Reset()

func (*Files) SizeVT

func (m *Files) SizeVT() (n int)

func (*Files) String

func (x *Files) String() string

func (*Files) UnmarshalJSON

func (x *Files) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Files from JSON.

func (*Files) UnmarshalProtoJSON

func (x *Files) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Files message from JSON.

func (*Files) UnmarshalVT

func (m *Files) UnmarshalVT(dAtA []byte) error

type JournalEntry

type JournalEntry struct {

	// Adds contains ownership edges applied before removals in this entry.
	Adds []*Edge `protobuf:"bytes,1,rep,name=adds,proto3" json:"adds,omitempty"`
	// Removes contains ownership edges deleted after additions in this entry.
	Removes []*Edge `protobuf:"bytes,2,rep,name=removes,proto3" json:"removes,omitempty"`
	// contains filtered or unexported fields
}

JournalEntry preserves one ordered GC ownership transition until replay.

func (*JournalEntry) CloneMessageVT

func (m *JournalEntry) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*JournalEntry) CloneVT

func (m *JournalEntry) CloneVT() *JournalEntry

func (*JournalEntry) EqualMessageVT

func (this *JournalEntry) EqualMessageVT(thatMsg any) bool

func (*JournalEntry) EqualVT

func (this *JournalEntry) EqualVT(that *JournalEntry) bool

func (*JournalEntry) GetAdds

func (x *JournalEntry) GetAdds() []*Edge

func (*JournalEntry) GetRemoves

func (x *JournalEntry) GetRemoves() []*Edge

func (*JournalEntry) MarshalJSON

func (x *JournalEntry) MarshalJSON() ([]byte, error)

MarshalJSON marshals the JournalEntry to JSON.

func (*JournalEntry) MarshalProtoJSON

func (x *JournalEntry) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the JournalEntry message to JSON.

func (*JournalEntry) MarshalProtoText

func (x *JournalEntry) MarshalProtoText() string

func (*JournalEntry) MarshalToSizedBufferVT

func (m *JournalEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*JournalEntry) MarshalToVT

func (m *JournalEntry) MarshalToVT(dAtA []byte) (int, error)

func (*JournalEntry) MarshalVT

func (m *JournalEntry) MarshalVT() (dAtA []byte, err error)

func (*JournalEntry) ProtoMessage

func (*JournalEntry) ProtoMessage()

func (*JournalEntry) Reset

func (x *JournalEntry) Reset()

func (*JournalEntry) SizeVT

func (m *JournalEntry) SizeVT() (n int)

func (*JournalEntry) String

func (x *JournalEntry) String() string

func (*JournalEntry) UnmarshalJSON

func (x *JournalEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JournalEntry from JSON.

func (*JournalEntry) UnmarshalProtoJSON

func (x *JournalEntry) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the JournalEntry message from JSON.

func (*JournalEntry) UnmarshalVT

func (m *JournalEntry) UnmarshalVT(dAtA []byte) error

type Location

type Location struct {

	// Pack names the immutable payload file containing this extent.
	Pack string `protobuf:"bytes,1,opt,name=pack,proto3" json:"pack,omitempty"`
	// Offset is the first payload byte within Pack.
	Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// Length is the number of payload bytes in the extent.
	Length uint32 `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"`
	// Checksum is the IEEE CRC32 of the complete payload extent.
	Checksum uint32 `protobuf:"varint,4,opt,name=checksum,proto3" json:"checksum,omitempty"`
	// PackBytes is the complete file length, bounding aligned reads at the tail.
	PackBytes uint32 `protobuf:"varint,5,opt,name=pack_bytes,json=packBytes,proto3" json:"packBytes,omitempty"`
	// contains filtered or unexported fields
}

Location identifies an immutable payload extent and its full-record checksum.

func (*Location) CloneMessageVT

func (m *Location) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Location) CloneVT

func (m *Location) CloneVT() *Location

func (*Location) EqualMessageVT

func (this *Location) EqualMessageVT(thatMsg any) bool

func (*Location) EqualVT

func (this *Location) EqualVT(that *Location) bool

func (*Location) GetChecksum

func (x *Location) GetChecksum() uint32

func (*Location) GetLength

func (x *Location) GetLength() uint32

func (*Location) GetOffset

func (x *Location) GetOffset() uint64

func (*Location) GetPack

func (x *Location) GetPack() string

func (*Location) GetPackBytes

func (x *Location) GetPackBytes() uint32

func (*Location) MarshalJSON

func (x *Location) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Location to JSON.

func (*Location) MarshalProtoJSON

func (x *Location) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Location message to JSON.

func (*Location) MarshalProtoText

func (x *Location) MarshalProtoText() string

func (*Location) MarshalToSizedBufferVT

func (m *Location) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Location) MarshalToVT

func (m *Location) MarshalToVT(dAtA []byte) (int, error)

func (*Location) MarshalVT

func (m *Location) MarshalVT() (dAtA []byte, err error)

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) Reset

func (x *Location) Reset()

func (*Location) SizeVT

func (m *Location) SizeVT() (n int)

func (*Location) String

func (x *Location) String() string

func (*Location) UnmarshalJSON

func (x *Location) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Location from JSON.

func (*Location) UnmarshalProtoJSON

func (x *Location) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Location message from JSON.

func (*Location) UnmarshalVT

func (m *Location) UnmarshalVT(dAtA []byte) error

type Pack

type Pack struct {

	// Records preserves complete block identities and locations in payload arrival order.
	Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	// LiveBytes counts payload bytes still referenced in this pack.
	LiveBytes uint64 `protobuf:"varint,2,opt,name=live_bytes,json=liveBytes,proto3" json:"liveBytes,omitempty"`
	// CleanupKey identifies the ordered internal queue entry for this pack.
	CleanupKey []byte `protobuf:"bytes,3,opt,name=cleanup_key,json=cleanupKey,proto3" json:"cleanupKey,omitempty"`
	// contains filtered or unexported fields
}

Pack records the complete block identities and extents in one payload file.

func (*Pack) CloneMessageVT

func (m *Pack) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Pack) CloneVT

func (m *Pack) CloneVT() *Pack

func (*Pack) EqualMessageVT

func (this *Pack) EqualMessageVT(thatMsg any) bool

func (*Pack) EqualVT

func (this *Pack) EqualVT(that *Pack) bool

func (*Pack) GetCleanupKey

func (x *Pack) GetCleanupKey() []byte

func (*Pack) GetLiveBytes

func (x *Pack) GetLiveBytes() uint64

func (*Pack) GetRecords

func (x *Pack) GetRecords() []*Record

func (*Pack) MarshalJSON

func (x *Pack) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Pack to JSON.

func (*Pack) MarshalProtoJSON

func (x *Pack) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Pack message to JSON.

func (*Pack) MarshalProtoText

func (x *Pack) MarshalProtoText() string

func (*Pack) MarshalToSizedBufferVT

func (m *Pack) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Pack) MarshalToVT

func (m *Pack) MarshalToVT(dAtA []byte) (int, error)

func (*Pack) MarshalVT

func (m *Pack) MarshalVT() (dAtA []byte, err error)

func (*Pack) ProtoMessage

func (*Pack) ProtoMessage()

func (*Pack) Reset

func (x *Pack) Reset()

func (*Pack) SizeVT

func (m *Pack) SizeVT() (n int)

func (*Pack) String

func (x *Pack) String() string

func (*Pack) UnmarshalJSON

func (x *Pack) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Pack from JSON.

func (*Pack) UnmarshalProtoJSON

func (x *Pack) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Pack message from JSON.

func (*Pack) UnmarshalVT

func (m *Pack) UnmarshalVT(dAtA []byte) error

type Partition

type Partition struct {

	// Lower is the inclusive lower key bound of this range.
	Lower []byte `protobuf:"bytes,1,opt,name=lower,proto3" json:"lower,omitempty"`
	// Runs lists at most four immutable runs, oldest first.
	Runs []*RunFile `protobuf:"bytes,2,rep,name=runs,proto3" json:"runs,omitempty"`
	// contains filtered or unexported fields
}

Partition covers keys up to the next partition and bounds overlapping runs.

func (*Partition) CloneMessageVT

func (m *Partition) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Partition) CloneVT

func (m *Partition) CloneVT() *Partition

func (*Partition) EqualMessageVT

func (this *Partition) EqualMessageVT(thatMsg any) bool

func (*Partition) EqualVT

func (this *Partition) EqualVT(that *Partition) bool

func (*Partition) GetLower

func (x *Partition) GetLower() []byte

func (*Partition) GetRuns

func (x *Partition) GetRuns() []*RunFile

func (*Partition) MarshalJSON

func (x *Partition) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Partition to JSON.

func (*Partition) MarshalProtoJSON

func (x *Partition) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Partition message to JSON.

func (*Partition) MarshalProtoText

func (x *Partition) MarshalProtoText() string

func (*Partition) MarshalToSizedBufferVT

func (m *Partition) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Partition) MarshalToVT

func (m *Partition) MarshalToVT(dAtA []byte) (int, error)

func (*Partition) MarshalVT

func (m *Partition) MarshalVT() (dAtA []byte, err error)

func (*Partition) ProtoMessage

func (*Partition) ProtoMessage()

func (*Partition) Reset

func (x *Partition) Reset()

func (*Partition) SizeVT

func (m *Partition) SizeVT() (n int)

func (*Partition) String

func (x *Partition) String() string

func (*Partition) UnmarshalJSON

func (x *Partition) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Partition from JSON.

func (*Partition) UnmarshalProtoJSON

func (x *Partition) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Partition message from JSON.

func (*Partition) UnmarshalVT

func (m *Partition) UnmarshalVT(dAtA []byte) error

type Record

type Record struct {

	// Key is the complete binary identity, including its internal namespace.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Value holds the current encoded value when Deleted is false.
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Deleted hides older values for this key until run consolidation.
	Deleted bool `protobuf:"varint,3,opt,name=deleted,proto3" json:"deleted,omitempty"`
	// contains filtered or unexported fields
}

Record is one complete key and its current value or deletion.

func (*Record) CloneMessageVT

func (m *Record) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Record) CloneVT

func (m *Record) CloneVT() *Record

func (*Record) EqualMessageVT

func (this *Record) EqualMessageVT(thatMsg any) bool

func (*Record) EqualVT

func (this *Record) EqualVT(that *Record) bool

func (*Record) GetDeleted

func (x *Record) GetDeleted() bool

func (*Record) GetKey

func (x *Record) GetKey() []byte

func (*Record) GetValue

func (x *Record) GetValue() []byte

func (*Record) MarshalJSON

func (x *Record) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Record to JSON.

func (*Record) MarshalProtoJSON

func (x *Record) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Record message to JSON.

func (*Record) MarshalProtoText

func (x *Record) MarshalProtoText() string

func (*Record) MarshalToSizedBufferVT

func (m *Record) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Record) MarshalToVT

func (m *Record) MarshalToVT(dAtA []byte) (int, error)

func (*Record) MarshalVT

func (m *Record) MarshalVT() (dAtA []byte, err error)

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (x *Record) Reset()

func (*Record) SizeVT

func (m *Record) SizeVT() (n int)

func (*Record) String

func (x *Record) String() string

func (*Record) UnmarshalJSON

func (x *Record) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Record from JSON.

func (*Record) UnmarshalProtoJSON

func (x *Record) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Record message from JSON.

func (*Record) UnmarshalVT

func (m *Record) UnmarshalVT(dAtA []byte) error

type ReplayTarget

type ReplayTarget struct {
	*Engine
	*BlockStore
}

ReplayTarget drives a format 3 engine and its block store as one workload replay target.

func (ReplayTarget) AppendJournal

func (t ReplayTarget) AppendJournal(ctx context.Context, adds, removes []block_gc.RefEdge) error

AppendJournal journals reference changes through the engine.

func (ReplayTarget) ReplayJournal

func (t ReplayTarget) ReplayJournal(ctx context.Context, apply func(adds, removes []block_gc.RefEdge) error) error

ReplayJournal passes every journaled change to apply through the engine's write-ahead log replay.

type Root

type Root struct {

	// Format identifies the immutable layout accepted by this engine.
	Format uint32 `protobuf:"varint,1,opt,name=format,proto3" json:"format,omitempty"`
	// Generation orders all root publications, including physical maintenance.
	Generation uint64 `protobuf:"varint,2,opt,name=generation,proto3" json:"generation,omitempty"`
	// Catalogue names the immutable root routing page.
	Catalogue string `protobuf:"bytes,3,opt,name=catalogue,proto3" json:"catalogue,omitempty"`
	// ReclaimNext is the first retirement generation still requiring examination.
	ReclaimNext uint64 `protobuf:"varint,4,opt,name=reclaim_next,json=reclaimNext,proto3" json:"reclaimNext,omitempty"`
	// Publication identifies the intent that produced this committed root.
	Publication string `protobuf:"bytes,5,opt,name=publication,proto3" json:"publication,omitempty"`
	// RetireThrough is the last logical publication with retirement records.
	RetireThrough uint64 `protobuf:"varint,6,opt,name=retire_through,json=retireThrough,proto3" json:"retireThrough,omitempty"`
	// BlockCount counts live payload locations in the committed index.
	BlockCount uint64 `protobuf:"varint,7,opt,name=block_count,json=blockCount,proto3" json:"blockCount,omitempty"`
	// BlockBytes sums the lengths of live payload locations.
	BlockBytes uint64 `protobuf:"varint,8,opt,name=block_bytes,json=blockBytes,proto3" json:"blockBytes,omitempty"`
	// JournalSequence is the last allocated GC journal sequence.
	JournalSequence uint64 `protobuf:"varint,9,opt,name=journal_sequence,json=journalSequence,proto3" json:"journalSequence,omitempty"`
	// Revision changes for logical writes, not relocation or retirement.
	Revision uint64 `protobuf:"varint,10,opt,name=revision,proto3" json:"revision,omitempty"`
	// contains filtered or unexported fields
}

Root selects one complete immutable catalogue.

func (*Root) CloneMessageVT

func (m *Root) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Root) CloneVT

func (m *Root) CloneVT() *Root

func (*Root) EqualMessageVT

func (this *Root) EqualMessageVT(thatMsg any) bool

func (*Root) EqualVT

func (this *Root) EqualVT(that *Root) bool

func (*Root) GetBlockBytes

func (x *Root) GetBlockBytes() uint64

func (*Root) GetBlockCount

func (x *Root) GetBlockCount() uint64

func (*Root) GetCatalogue

func (x *Root) GetCatalogue() string

func (*Root) GetFormat

func (x *Root) GetFormat() uint32

func (*Root) GetGeneration

func (x *Root) GetGeneration() uint64

func (*Root) GetJournalSequence

func (x *Root) GetJournalSequence() uint64

func (*Root) GetPublication

func (x *Root) GetPublication() string

func (*Root) GetReclaimNext

func (x *Root) GetReclaimNext() uint64

func (*Root) GetRetireThrough

func (x *Root) GetRetireThrough() uint64

func (*Root) GetRevision

func (x *Root) GetRevision() uint64

func (*Root) MarshalJSON

func (x *Root) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Root to JSON.

func (*Root) MarshalProtoJSON

func (x *Root) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Root message to JSON.

func (*Root) MarshalProtoText

func (x *Root) MarshalProtoText() string

func (*Root) MarshalToSizedBufferVT

func (m *Root) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Root) MarshalToVT

func (m *Root) MarshalToVT(dAtA []byte) (int, error)

func (*Root) MarshalVT

func (m *Root) MarshalVT() (dAtA []byte, err error)

func (*Root) ProtoMessage

func (*Root) ProtoMessage()

func (*Root) Reset

func (x *Root) Reset()

func (*Root) SizeVT

func (m *Root) SizeVT() (n int)

func (*Root) String

func (x *Root) String() string

func (*Root) UnmarshalJSON

func (x *Root) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Root from JSON.

func (*Root) UnmarshalProtoJSON

func (x *Root) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Root message from JSON.

func (*Root) UnmarshalVT

func (m *Root) UnmarshalVT(dAtA []byte) error

type Run

type Run struct {

	// Records contains complete keys in ascending byte order.
	Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

Run stores sorted small records, newest runs taking precedence.

func (*Run) CloneMessageVT

func (m *Run) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Run) CloneVT

func (m *Run) CloneVT() *Run

func (*Run) EqualMessageVT

func (this *Run) EqualMessageVT(thatMsg any) bool

func (*Run) EqualVT

func (this *Run) EqualVT(that *Run) bool

func (*Run) GetRecords

func (x *Run) GetRecords() []*Record

func (*Run) MarshalJSON

func (x *Run) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Run to JSON.

func (*Run) MarshalProtoJSON

func (x *Run) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Run message to JSON.

func (*Run) MarshalProtoText

func (x *Run) MarshalProtoText() string

func (*Run) MarshalToSizedBufferVT

func (m *Run) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Run) MarshalToVT

func (m *Run) MarshalToVT(dAtA []byte) (int, error)

func (*Run) MarshalVT

func (m *Run) MarshalVT() (dAtA []byte, err error)

func (*Run) ProtoMessage

func (*Run) ProtoMessage()

func (*Run) Reset

func (x *Run) Reset()

func (*Run) SizeVT

func (m *Run) SizeVT() (n int)

func (*Run) String

func (x *Run) String() string

func (*Run) UnmarshalJSON

func (x *Run) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Run from JSON.

func (*Run) UnmarshalProtoJSON

func (x *Run) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Run message from JSON.

func (*Run) UnmarshalVT

func (m *Run) UnmarshalVT(dAtA []byte) error

type RunFile

type RunFile struct {

	// Name is the immutable run file name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Bytes is the encoded run length, choosing which runs to merge.
	Bytes uint32 `protobuf:"varint,2,opt,name=bytes,proto3" json:"bytes,omitempty"`
	// Records counts every record in the run, including deletions.
	Records uint32 `protobuf:"varint,3,opt,name=records,proto3" json:"records,omitempty"`
	// Deleted counts deletion records that may hide older values.
	Deleted uint32 `protobuf:"varint,4,opt,name=deleted,proto3" json:"deleted,omitempty"`
	// contains filtered or unexported fields
}

RunFile names one immutable run and its encoded size.

func (*RunFile) CloneMessageVT

func (m *RunFile) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*RunFile) CloneVT

func (m *RunFile) CloneVT() *RunFile

func (*RunFile) EqualMessageVT

func (this *RunFile) EqualMessageVT(thatMsg any) bool

func (*RunFile) EqualVT

func (this *RunFile) EqualVT(that *RunFile) bool

func (*RunFile) GetBytes

func (x *RunFile) GetBytes() uint32

func (*RunFile) GetDeleted

func (x *RunFile) GetDeleted() uint32

func (*RunFile) GetName

func (x *RunFile) GetName() string

func (*RunFile) GetRecords

func (x *RunFile) GetRecords() uint32

func (*RunFile) MarshalJSON

func (x *RunFile) MarshalJSON() ([]byte, error)

MarshalJSON marshals the RunFile to JSON.

func (*RunFile) MarshalProtoJSON

func (x *RunFile) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the RunFile message to JSON.

func (*RunFile) MarshalProtoText

func (x *RunFile) MarshalProtoText() string

func (*RunFile) MarshalToSizedBufferVT

func (m *RunFile) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*RunFile) MarshalToVT

func (m *RunFile) MarshalToVT(dAtA []byte) (int, error)

func (*RunFile) MarshalVT

func (m *RunFile) MarshalVT() (dAtA []byte, err error)

func (*RunFile) ProtoMessage

func (*RunFile) ProtoMessage()

func (*RunFile) Reset

func (x *RunFile) Reset()

func (*RunFile) SizeVT

func (m *RunFile) SizeVT() (n int)

func (*RunFile) String

func (x *RunFile) String() string

func (*RunFile) UnmarshalJSON

func (x *RunFile) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the RunFile from JSON.

func (*RunFile) UnmarshalProtoJSON

func (x *RunFile) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the RunFile message from JSON.

func (*RunFile) UnmarshalVT

func (m *RunFile) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL