sealed

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 33 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockInfo

type BlockInfo struct {
	Info *frac.Info
}

func (*BlockInfo) Pack

func (b *BlockInfo) Pack(buf []byte) []byte

func (*BlockInfo) Unpack

func (b *BlockInfo) Unpack(data []byte) error

type BlockOffsets

type BlockOffsets struct {
	Offsets []uint64
}

func (*BlockOffsets) Pack

func (b *BlockOffsets) Pack(buf []byte) []byte

func (*BlockOffsets) Unpack

func (b *BlockOffsets) Unpack(data []byte, fracVer config.BinaryDataVersion) error

type BlocksData

type BlocksData struct {
	IDsTable      seqids.Table
	LIDsTable     *lids.Table
	BlocksOffsets []uint64
}

type DocBlockLocation added in v0.84.0

type DocBlockLocation = util.Pair[[]byte, uint64]

type ExprTIDs added in v0.84.0

type ExprTIDs struct {
	Key  string
	TIDs []uint32
}

type IndexCache added in v0.84.0

type IndexCache struct {
	// Registry cache for legacy sealed fractions.
	LegacyRegistry *cache.ConcurrentCache[[]byte]

	// Per-file registry caches (each IndexReader needs its own).
	TokenRegistry   *cache.ConcurrentCache[[]byte]
	OffsetsRegistry *cache.ConcurrentCache[[]byte]
	IDRegistry      *cache.ConcurrentCache[[]byte]
	LIDRegistry     *cache.ConcurrentCache[[]byte]

	// Block-level data caches shared across all readers.
	MIDs   *cache.ConcurrentCache[[]byte]
	RIDs   *cache.ConcurrentCache[seqids.BlockRIDs]
	Params *cache.ConcurrentCache[seqids.BlockParams]

	Tokens     *cache.ConcurrentCache[*token.Block]
	TokenTable *cache.ConcurrentCache[token.Table]

	LIDs *cache.ConcurrentCache[*lids.Block]

	ExprTIDs *cache.ConcurrentCache[ExprTIDs]
}

func NewIndexCache added in v0.84.0

func NewIndexCache() *IndexCache

func (*IndexCache) Release added in v0.84.0

func (s *IndexCache) Release()

type IndexReaders added in v0.84.0

type IndexReaders struct {
	Token   storage.IndexReader
	Offsets storage.IndexReader
	ID      storage.IndexReader
	LID     storage.IndexReader
}

IndexReaders holds one IndexReader per split index file.

type LegacyLoader added in v0.84.0

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

LegacyLoader reads the old single .index file format by scanning blocks sequentially. Block indices stored in lids.Table and seqids.Table are absolute within the .index file, so the same IndexReader can be passed to all sub-loaders unchanged.

func (*LegacyLoader) Load added in v0.84.0

func (l *LegacyLoader) Load(blocksData *BlocksData, info *frac.Info, reader storage.IndexReader)

Load populates blocksData from a single legacy .index file. It starts at block 1 (block 0 is the Info block, already read by loadHeader).

type Loader added in v0.84.0

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

Loader reads the per-section index files to populate BlocksData. Token data is loaded lazily (BlockLoader / TableLoader use the Token reader directly). Info is loaded separately via loadHeader before Load is called.

func (*Loader) Load added in v0.84.0

func (l *Loader) Load(blocksData *BlocksData, info *frac.Info, readers IndexReaders)

Load populates blocksData from the .offsets, .id, and .lid files.

type PSD added in v0.84.0

type PSD int // emulates hard shutdown on different stages of fraction deletion, used for tests
const (
	Off PSD = iota
	HalfRename
	HalfRemove
)

type PreloadedData

type PreloadedData struct {
	Info       *frac.Info
	BlocksData BlocksData
	TokenTable token.Table
}

type Remote added in v0.84.0

type Remote struct {
	Config *frac.Config

	BaseFileName string
	// contains filtered or unexported fields
}

Remote fraction is a fraction that is backed by remote storage.

Structure of Remote fraction is almost identical to the Sealed one. In fact, they share the same on-disk binary layout, access methods and any other logic, but having Remote fraction allows us to easily distinguish between local and remote fractions.

func NewRemote added in v0.84.0

func NewRemote(
	ctx context.Context,
	baseFile string,
	readLimiter *storage.ReadLimiter,
	indexCache *IndexCache,
	docsCache *cache.ConcurrentCache[[]byte],
	info *frac.Info,
	cfg *frac.Config,
	s3cli *s3.Client,
	skipMaskProvider frac.SkipMaskProvider,
) *Remote

func NewRemoteZombie added in v0.84.0

func NewRemoteZombie(
	ctx context.Context,
	baseFile string,
	s3cli *s3.Client,
	skipMaskProvider frac.SkipMaskProvider,
) *Remote

NewRemoteZombie creates a stub for a fraction pending remote deletion (offloading interrupted before commit, or deletion interrupted mid-way). It skips info loading entirely: deletion only needs the base name and the S3 client, and loading info would require reaching S3, which must not prevent the store from starting up.

func (*Remote) Contains added in v0.84.0

func (f *Remote) Contains(mid seq.MID) bool

func (*Remote) Fetch added in v0.84.0

func (f *Remote) Fetch(ctx context.Context, ids []seq.ID, noSkipMasks bool) ([][]byte, error)

func (*Remote) FindLIDs added in v0.84.0

func (f *Remote) FindLIDs(ctx context.Context, ids []seq.ID) ([]seq.LID, error)

func (*Remote) Info added in v0.84.0

func (f *Remote) Info() *frac.Info

func (*Remote) IsIntersecting added in v0.84.0

func (f *Remote) IsIntersecting(from, to seq.MID) bool

func (*Remote) IsSingleIndex added in v0.84.0

func (f *Remote) IsSingleIndex() bool

func (*Remote) Search added in v0.84.0

func (f *Remote) Search(ctx context.Context, params processor.SearchParams) (*seq.QPR, error)

func (*Remote) String added in v0.84.0

func (f *Remote) String() string

func (*Remote) Suicide added in v0.84.0

func (f *Remote) Suicide(ctx context.Context) error

type Sealed added in v0.84.0

type Sealed struct {
	Config *frac.Config

	BaseFileName string

	// shit for testing
	PartialSuicideMode PSD
	// contains filtered or unexported fields
}

func NewSealed added in v0.84.0

func NewSealed(
	baseFile string,
	readLimiter *storage.ReadLimiter,
	indexCache *IndexCache,
	docsCache *cache.ConcurrentCache[[]byte],
	info *frac.Info,
	cfg *frac.Config,
	skipMaskProvider frac.SkipMaskProvider,
) *Sealed

func NewSealedPreloaded added in v0.84.0

func NewSealedPreloaded(
	baseFile string,
	preloaded *PreloadedData,
	rl *storage.ReadLimiter,
	indexCache *IndexCache,
	docsCache *cache.ConcurrentCache[[]byte],
	cfg *frac.Config,
	skipMaskProvider frac.SkipMaskProvider,
) *Sealed

func (*Sealed) Contains added in v0.84.0

func (f *Sealed) Contains(id seq.MID) bool

func (*Sealed) Fetch added in v0.84.0

func (f *Sealed) Fetch(ctx context.Context, ids []seq.ID, noSkipMasks bool) ([][]byte, error)

func (*Sealed) FindLIDs added in v0.84.0

func (f *Sealed) FindLIDs(ctx context.Context, ids []seq.ID) ([]seq.LID, error)

func (*Sealed) Info added in v0.84.0

func (f *Sealed) Info() *frac.Info

func (*Sealed) IsIntersecting added in v0.84.0

func (f *Sealed) IsIntersecting(from, to seq.MID) bool

func (*Sealed) IsSingleIndex added in v0.84.0

func (f *Sealed) IsSingleIndex() bool

func (*Sealed) Offload added in v0.84.0

func (f *Sealed) Offload(ctx context.Context, u storage.Uploader) error

Offload saves all index files and docs to remote storage.

func (*Sealed) Release added in v0.84.0

func (f *Sealed) Release()

func (*Sealed) Search added in v0.84.0

func (f *Sealed) Search(ctx context.Context, params processor.SearchParams) (*seq.QPR, error)

func (*Sealed) String added in v0.84.0

func (f *Sealed) String() string

func (*Sealed) Suicide added in v0.84.0

func (f *Sealed) Suicide()

type SealedSource added in v0.84.0

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

SealedSource implements frac.Source for a sealed fraction. Used as input to [compaction.MergeSource] when compacting multiple fractions.

func NewSealedSource added in v0.84.0

func NewSealedSource(f *Sealed) *SealedSource

func (*SealedSource) BlockOffsets added in v0.84.0

func (s *SealedSource) BlockOffsets() []uint64

func (*SealedSource) DocBlocks added in v0.84.0

func (s *SealedSource) DocBlocks() iter.Seq2[DocBlockLocation, error]

func (*SealedSource) DocsReader added in v0.84.0

func (s *SealedSource) DocsReader() (io.ReadCloser, error)

func (*SealedSource) IDs added in v0.84.0

func (*SealedSource) Info added in v0.84.0

func (s *SealedSource) Info() *frac.Info

func (*SealedSource) TokenTriplets added in v0.84.0

func (s *SealedSource) TokenTriplets() iter.Seq2[string, iter.Seq2[frac.TokenLIDs, error]]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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