index

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("tae index: key not found")
	ErrDuplicate = errors.New("tae index: key duplicate")
	ErrWrongType = errors.New("tae index: wrong type")
)

Functions

func NewMultiplRowsART

func NewMultiplRowsART(typ types.Type) *mvART

func NewSimpleARTMap

func NewSimpleARTMap(typ types.Type) *simpleARTMap

Types

type BatchResp

type BatchResp struct {
	UpdatedKeys *roaring.Bitmap
	UpdatedRows *roaring.Bitmap
}

type KeysCtx

type KeysCtx struct {
	Keys containers.Vector

	// Select the key where this bitmap indicates.
	// Nil to select all
	Selects *roaring.Bitmap
	// Select a continous interval [Start, Start+Count) from keys
	Start, Count int

	// Whether need to verify Keys
	NeedVerify bool
}

func (*KeysCtx) SelectAll

func (ctx *KeysCtx) SelectAll()

type MutipleRowsIndex

type MutipleRowsIndex interface {
	Insert(key any, row uint32) error
	DeleteOne(key any, row uint32) (int, error)
	DeleteAll(key any) error
	GetRowsNode(key any) (*RowsNode, bool)
	Contains(key any) bool
	ContainsRow(key any, row uint32) bool
	Size() int
	RowCount(key any) int
}

type RowsNode

type RowsNode struct {
	Ids []uint32
}

func NewRowsNode

func NewRowsNode() *RowsNode

func (*RowsNode) Clone

func (n *RowsNode) Clone() *RowsNode

func (*RowsNode) DeleteRow

func (n *RowsNode) DeleteRow(row uint32) (pos int, deleted bool)

func (*RowsNode) HasRow

func (n *RowsNode) HasRow(row uint32) (exist bool)

func (*RowsNode) Size

func (n *RowsNode) Size() int

type SecondaryIndex

type SecondaryIndex interface {
	Insert(key any, row uint32) error
	BatchInsert(keys *KeysCtx, startRow uint32, upsert bool) (resp *BatchResp, err error)
	Update(key any, row uint32) error
	BatchUpdate(keys containers.Vector, offsets []uint32, start uint32) error
	Delete(key any) (old uint32, err error)
	Search(key any) (uint32, error)
	Contains(key any) bool
	ContainsAny(keysCtx *KeysCtx, rowmask *roaring.Bitmap) bool
	String() string
	Size() int
}

type StaticFilter

type StaticFilter interface {
	MayContainsKey(key any) (bool, error)
	MayContainsAnyKeys(keys containers.Vector, visibility *roaring.Bitmap) (bool, *roaring.Bitmap, error)
	Marshal() ([]byte, error)
	Unmarshal(buf []byte) error
	GetMemoryUsage() uint32
	Print() string
}

func NewBinaryFuseFilter

func NewBinaryFuseFilter(data containers.Vector) (StaticFilter, error)

func NewBinaryFuseFilterFromSource

func NewBinaryFuseFilterFromSource(data []byte) (StaticFilter, error)

type ZoneMap

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

func LoadZoneMapFrom

func LoadZoneMapFrom(data []byte) (zm *ZoneMap, err error)

func NewZoneMap

func NewZoneMap(typ types.Type) *ZoneMap

func (*ZoneMap) BatchUpdate

func (zm *ZoneMap) BatchUpdate(KeysCtx *KeysCtx) error

func (*ZoneMap) Contains

func (zm *ZoneMap) Contains(key any) (ok bool)

func (*ZoneMap) ContainsAny

func (zm *ZoneMap) ContainsAny(keys containers.Vector) (visibility *roaring.Bitmap, ok bool)

func (*ZoneMap) GetMax

func (zm *ZoneMap) GetMax() any

func (*ZoneMap) GetMemoryUsage

func (zm *ZoneMap) GetMemoryUsage() uint64

func (*ZoneMap) GetMin

func (zm *ZoneMap) GetMin() any

func (*ZoneMap) GetType

func (zm *ZoneMap) GetType() types.Type

func (*ZoneMap) Marshal

func (zm *ZoneMap) Marshal() (buf []byte, err error)

func (*ZoneMap) SetMax

func (zm *ZoneMap) SetMax(v any)

func (*ZoneMap) SetMin

func (zm *ZoneMap) SetMin(v any)

func (*ZoneMap) Unmarshal

func (zm *ZoneMap) Unmarshal(buf []byte) error

func (*ZoneMap) Update

func (zm *ZoneMap) Update(v any) (err error)

Jump to

Keyboard shortcuts

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