Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFilesList ¶
func NewFilesList() *filesList
Types ¶
type DirectoryIndexMerger ¶
type DirectoryIndexMerger[T constraints.Ordered] struct { // contains filtered or unexported fields }
func (*DirectoryIndexMerger[T]) Cleanup ¶
func (m *DirectoryIndexMerger[T]) Cleanup() (err error)
Cleanup removes files that are merged. Synchronous.
func (*DirectoryIndexMerger[T]) Merge ¶
func (m *DirectoryIndexMerger[T]) Merge() (files []*indexFile, err error)
Merge is synchronous. It selects files for merging and proceeds the merge operation. It returns merged files.
type IndexDirectory ¶
type IndexDirectory[T constraints.Ordered] struct { // contains filtered or unexported fields }
IndexDirectory manages multiple index files in a directory. it supports the same read/write API as a single index file and also manages concurrent merging process (removing merged files to keep the disk space low).
func NewIndexDirectory ¶
func NewIndexDirectory[T constraints.Ordered]( path string, segmentSize uint32, serializeValues func([]T) ([]byte, error), unserializeValues func([]byte) ([]T, error), ) (*IndexDirectory[T], error)
func (*IndexDirectory[T]) NewMerger ¶
func (d *IndexDirectory[T]) NewMerger(min, max int) (*DirectoryIndexMerger[T], error)
NewMerger creates a merging service that merges between min,max files in one pass.
func (*IndexDirectory[T]) NewReader ¶
func (d *IndexDirectory[T]) NewReader() (*IndexDirectoryReader[T], error)
NewReader makes a new InvertedIndexReader that hides multiple files. A reader multiplex readers from individual files and allows early closing via Close() call.
func (*IndexDirectory[T]) NewWriter ¶
func (d *IndexDirectory[T]) NewWriter() (single.InvertedIndexWriter[T], error)
type IndexDirectoryReader ¶
type IndexDirectoryReader[T constraints.Ordered] struct { // contains filtered or unexported fields }
func (*IndexDirectoryReader[T]) Close ¶
func (i *IndexDirectoryReader[T]) Close() error
func (*IndexDirectoryReader[T]) ReadTerms ¶
func (i *IndexDirectoryReader[T]) ReadTerms() (go_iterators.Iterator[string], error)
func (*IndexDirectoryReader[T]) ReadValues ¶
func (i *IndexDirectoryReader[T]) ReadValues(terms []string, min T, max T) (go_iterators.Iterator[T], error)
type IndexDirectoryWriter ¶
type IndexDirectoryWriter[T constraints.Ordered] struct { // contains filtered or unexported fields }
func (*IndexDirectoryWriter[T]) Close ¶
func (i *IndexDirectoryWriter[T]) Close() error
func (*IndexDirectoryWriter[T]) Put ¶
func (i *IndexDirectoryWriter[T]) Put(term string, values []T) error
Click to show internal directories.
Click to hide internal directories.