index

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRangeOperation = errors.New("this is not an range operation")
	ErrEmptyTree         = errors.New("tree is empty")
)
View Source
var DefaultLower = convert.Uint64ToBytes(0)
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 Condition

type Condition map[FieldKey][]ConditionValue

type ConditionValue

type ConditionValue struct {
	Values [][]byte
	Op     modelv1.Condition_BinaryOp
}

type Executor

type Executor interface {
	Execute() (posting.List, error)
}

type Field

type Field struct {
	Key  FieldKey
	Term []byte
}

func (Field) Marshal

func (f Field) Marshal(term metadata.Term) ([]byte, error)

func (Field) MarshalStraight

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

func (*Field) Unmarshal

func (f *Field) Unmarshal(term metadata.Term, raw []byte) error

func (*Field) UnmarshalStraight

func (f *Field) UnmarshalStraight(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,
	metadata metadata.Term, 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
	EncodeTerm  bool
}

func (FieldKey) Equal

func (f FieldKey) Equal(other FieldKey) bool

func (FieldKey) Marshal

func (f FieldKey) Marshal() []byte

func (*FieldKey) Unmarshal

func (f *FieldKey) Unmarshal(raw []byte) 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
	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 Tree

type Tree interface {
	Executor
	TrimRangeLeaf(key FieldKey) (rangeOpts RangeOpts, found bool)
}

func BuildTree

func BuildTree(searcher Searcher, condMap Condition) (Tree, error)

type Writer

type Writer interface {
	Write(field 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