Documentation
¶
Index ¶
- type BlockInfo
- type BlockOffsets
- type BlocksData
- type DocBlockLocation
- type ExprTIDs
- type IndexCache
- type IndexReaders
- type LegacyLoader
- type Loader
- type PSD
- type PreloadedData
- type Remote
- func (f *Remote) Contains(mid seq.MID) bool
- func (f *Remote) Fetch(ctx context.Context, ids []seq.ID, noSkipMasks bool) ([][]byte, error)
- func (f *Remote) FindLIDs(ctx context.Context, ids []seq.ID) ([]seq.LID, error)
- func (f *Remote) Info() *frac.Info
- func (f *Remote) IsIntersecting(from, to seq.MID) bool
- func (f *Remote) IsSingleIndex() bool
- func (f *Remote) Search(ctx context.Context, params processor.SearchParams) (*seq.QPR, error)
- func (f *Remote) String() string
- func (f *Remote) Suicide(ctx context.Context) error
- type Sealed
- func (f *Sealed) Contains(id seq.MID) bool
- func (f *Sealed) Fetch(ctx context.Context, ids []seq.ID, noSkipMasks bool) ([][]byte, error)
- func (f *Sealed) FindLIDs(ctx context.Context, ids []seq.ID) ([]seq.LID, error)
- func (f *Sealed) Info() *frac.Info
- func (f *Sealed) IsIntersecting(from, to seq.MID) bool
- func (f *Sealed) IsSingleIndex() bool
- func (f *Sealed) Offload(ctx context.Context, u storage.Uploader) error
- func (f *Sealed) Release()
- func (f *Sealed) Search(ctx context.Context, params processor.SearchParams) (*seq.QPR, error)
- func (f *Sealed) String() string
- func (f *Sealed) Suicide()
- type SealedSource
- func (s *SealedSource) BlockOffsets() []uint64
- func (s *SealedSource) DocBlocks() iter.Seq2[DocBlockLocation, error]
- func (s *SealedSource) DocsReader() (io.ReadCloser, error)
- func (s *SealedSource) IDs() iter.Seq2[frac.DocLocation, error]
- func (s *SealedSource) Info() *frac.Info
- func (s *SealedSource) TokenTriplets() iter.Seq2[string, iter.Seq2[frac.TokenLIDs, error]]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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
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) IsIntersecting ¶ added in v0.84.0
func (*Remote) IsSingleIndex ¶ added in v0.84.0
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) IsIntersecting ¶ added in v0.84.0
func (*Sealed) IsSingleIndex ¶ added in v0.84.0
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 (s *SealedSource) IDs() iter.Seq2[frac.DocLocation, error]
func (*SealedSource) Info ¶ added in v0.84.0
func (s *SealedSource) Info() *frac.Info