indexwrapper

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImmutableIndex

func NewImmutableIndex() *immutableIndex

func NewMutableIndex

func NewMutableIndex(keyT types.Type) *nonPkMutIndex

func NewPkMutableIndex added in v0.6.0

func NewPkMutableIndex(keyT types.Type) *mutableIndex

func TranslateError

func TranslateError(err error) error

Types

type BFWriter

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

func NewBFWriter

func NewBFWriter() *BFWriter

func (*BFWriter) AddValues

func (writer *BFWriter) AddValues(values containers.Vector) error

func (*BFWriter) Finalize

func (writer *BFWriter) Finalize() (*IndexMeta, error)

func (*BFWriter) Init

func (writer *BFWriter) Init(wr objectio.Writer, block objectio.BlockObject, cType common.CompressType, colIdx uint16, internalIdx uint16) error

func (*BFWriter) Query

func (writer *BFWriter) Query(key any) (bool, error)

Query is only used for testing or debugging

type BfReader added in v0.6.0

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

func (*BfReader) Destroy added in v0.6.0

func (r *BfReader) Destroy() error

func (*BfReader) MayContainsAnyKeys added in v0.6.0

func (r *BfReader) MayContainsAnyKeys(keys containers.Vector, visibility *roaring.Bitmap) (b bool, m *roaring.Bitmap, err error)

func (*BfReader) MayContainsKey added in v0.6.0

func (r *BfReader) MayContainsKey(key any) (b bool, err error)

type Index

type Index interface {
	io.Closer
	Destroy() error

	// Dedup returns wether the specified key is existed
	// If key is existed, return ErrDuplicate
	// If any other unknown error happens, return error
	// If key is not found, return nil
	Dedup(key any, skipfn func(row uint32) error) error

	BatchDedup(keys containers.Vector, skipfn func(row uint32) (err error)) (keyselects *roaring.Bitmap, err error)

	// BatchUpsert batch insert the specific keys
	// If any deduplication, it will fetch the old value first, fill the active map with new value, insert the old value into delete map
	// If any other unknown error hanppens, return error
	BatchUpsert(keysCtx *index.KeysCtx, offset int) (err error)

	GetActiveRow(key any) (row []uint32, err error)

	String() string
}

type IndexMeta

type IndexMeta struct {
	IdxType     IndexType
	CompType    common.CompressType
	ColIdx      uint16
	InternalIdx uint16
	Size        uint32
	RawSize     uint32
}

func NewEmptyIndexMeta

func NewEmptyIndexMeta() *IndexMeta

func (*IndexMeta) Marshal

func (meta *IndexMeta) Marshal() ([]byte, error)

func (*IndexMeta) SetCompressType

func (meta *IndexMeta) SetCompressType(typ common.CompressType)

func (*IndexMeta) SetIndexType

func (meta *IndexMeta) SetIndexType(typ IndexType)

func (*IndexMeta) SetIndexedColumn

func (meta *IndexMeta) SetIndexedColumn(colIdx uint16)

func (*IndexMeta) SetInternalIndex

func (meta *IndexMeta) SetInternalIndex(idx uint16)

func (*IndexMeta) SetSize

func (meta *IndexMeta) SetSize(raw, exact uint32)

func (*IndexMeta) Unmarshal

func (meta *IndexMeta) Unmarshal(buf []byte) error

type IndexType

type IndexType uint8
const (
	InvalidIndexType IndexType = iota
	BlockZoneMapIndex
	SegmentZoneMapIndex
	StaticFilterIndex
	ARTIndex
)

type IndicesMeta

type IndicesMeta struct {
	Metas []IndexMeta
}

func NewEmptyIndicesMeta

func NewEmptyIndicesMeta() *IndicesMeta

func (*IndicesMeta) AddIndex

func (metas *IndicesMeta) AddIndex(meta ...IndexMeta)

func (*IndicesMeta) Marshal

func (metas *IndicesMeta) Marshal() ([]byte, error)

func (*IndicesMeta) Unmarshal

func (metas *IndicesMeta) Unmarshal(buf []byte) error

type ZMWriter

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

func NewZMWriter

func NewZMWriter() *ZMWriter

func (*ZMWriter) AddValues

func (writer *ZMWriter) AddValues(values containers.Vector) (err error)

func (*ZMWriter) Finalize

func (writer *ZMWriter) Finalize() (*IndexMeta, error)

func (*ZMWriter) Init

func (writer *ZMWriter) Init(wr objectio.Writer, block objectio.BlockObject, cType common.CompressType, colIdx uint16, internalIdx uint16) error

func (*ZMWriter) SetMinMax

func (writer *ZMWriter) SetMinMax(min, max any, typ types.Type) (err error)

func (*ZMWriter) String added in v0.7.0

func (writer *ZMWriter) String() string

type ZmReader added in v0.6.0

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

func (*ZmReader) Contains added in v0.6.0

func (r *ZmReader) Contains(key any) bool

func (*ZmReader) ContainsAny added in v0.6.0

func (r *ZmReader) ContainsAny(keys containers.Vector) (visibility *roaring.Bitmap, ok bool)

func (*ZmReader) Destroy added in v0.6.0

func (r *ZmReader) Destroy() error

func (*ZmReader) FastContainsAny added in v0.7.0

func (r *ZmReader) FastContainsAny(keys containers.Vector) (ok bool)

Jump to

Keyboard shortcuts

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