index

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultUpper = convert.Uint64ToBytes(math.MaxUint64)
	DefaultLower = convert.Uint64ToBytes(0)
)
View Source
var EmptyFieldIterator = &emptyIterator{}
View Source
var ErrMalformed = errors.New("the data is malformed")

Functions

This section is empty.

Types

type CompositePostingValueFn

type CompositePostingValueFn = func(term, value []byte, delegated kv.Iterator) (*PostingValue, error)

type Field

type Field struct {
	Key  FieldKey
	Term []byte
}

func (Field) Marshal

func (f Field) Marshal() ([]byte, error)

func (*Field) Unmarshal

func (f *Field) Unmarshal(raw []byte) error

type FieldIterable

type FieldIterable interface {
	Iterator(fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort) (iter FieldIterator, err error)
}

type FieldIterator

type FieldIterator interface {
	Next() bool
	Val() *PostingValue
	Close() error
}

func NewMergedIterator

func NewMergedIterator(merged []FieldIterator, fn SwitchFn) FieldIterator

type FieldIteratorTemplate

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

func NewFieldIteratorTemplate

func NewFieldIteratorTemplate(l *logger.Logger, fieldKey FieldKey, termRange RangeOpts, order modelv1.Sort, iterable kv.Iterable,
	fn CompositePostingValueFn,
) (*FieldIteratorTemplate, error)

func (*FieldIteratorTemplate) Close

func (f *FieldIteratorTemplate) Close() error

func (*FieldIteratorTemplate) Next

func (f *FieldIteratorTemplate) Next() bool

func (*FieldIteratorTemplate) Val

type FieldKey

type FieldKey struct {
	SeriesID    common.SeriesID
	IndexRuleID uint32
	Analyzer    databasev1.IndexRule_Analyzer
}

func (FieldKey) Equal

func (f FieldKey) Equal(other FieldKey) bool

func (FieldKey) Marshal

func (f FieldKey) Marshal() []byte

func (FieldKey) MarshalToStr added in v0.2.0

func (f FieldKey) MarshalToStr() string

func (*FieldKey) Unmarshal

func (f *FieldKey) Unmarshal(raw []byte) error

type Filter added in v0.2.0

type Filter interface {
	fmt.Stringer
	Execute(getSearcher GetSearcher, seriesID common.SeriesID) (posting.List, error)
}

type GetSearcher added in v0.2.0

type GetSearcher func(location databasev1.IndexRule_Type) (Searcher, error)

type PostingValue

type PostingValue struct {
	Term  []byte
	Value posting.List
}

type RangeOpts

type RangeOpts struct {
	Upper         []byte
	Lower         []byte
	IncludesUpper bool
	IncludesLower bool
}

func (RangeOpts) Between

func (r RangeOpts) Between(value []byte) int

type Searcher

type Searcher interface {
	FieldIterable
	Match(fieldKey FieldKey, match []string) (list posting.List, err error)
	MatchField(fieldKey FieldKey) (list posting.List, err error)
	MatchTerms(field Field) (list posting.List, err error)
	Range(fieldKey FieldKey, opts RangeOpts) (list posting.List, err error)
}

type Store

type Store interface {
	observability.Observable
	io.Closer
	Writer
	Searcher
	// Flush flushed memory data to disk
	Flush() error
}

type SwitchFn

type SwitchFn = func(a, b []byte) bool

type Writer

type Writer interface {
	Write(fields []Field, itemID common.ItemID) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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