containers

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendBytes added in v0.6.0

func AppendBytes(vec *movec.Vector, v any)

func AppendFixedValue added in v0.6.0

func AppendFixedValue[T types.FixedSizeT](vec *movec.Vector, v any)

func AppendValue added in v0.6.0

func AppendValue(vec *movec.Vector, v any)

func ApplyUpdateToVector added in v0.6.0

func ApplyUpdateToVector(vec *movec.Vector, mask *roaring.Bitmap, vals map[uint32]any) *movec.Vector

func ApplyUpdates

func ApplyUpdates(vec Vector, mask *roaring.Bitmap, vals map[uint32]any)

func BatchWindow added in v0.6.0

func BatchWindow(bat *batch.Batch, start, end int) *batch.Batch

func CopyToMoBatch added in v0.6.0

func CopyToMoBatch(bat *Batch) *batch.Batch

func CopyToMoVec added in v0.6.0

func CopyToMoVec(vec Vector) (mov *movec.Vector)

func CopyToMoVecs added in v0.6.0

func CopyToMoVecs(vecs []Vector) []*movec.Vector

Deep copy

func CopyToProtoBatch added in v0.6.0

func CopyToProtoBatch(bat *Batch) (*api.Batch, error)

func CopyToProtoVector added in v0.6.0

func CopyToProtoVector(vec Vector) (*api.Vector, error)

func ForEachValue added in v0.6.0

func ForEachValue(col *movec.Vector, reversed bool, op func(v any, row uint32) error) (err error)

func GenericUpdateBytes added in v0.6.0

func GenericUpdateBytes(vec *movec.Vector, row uint32, v any)

func GenericUpdateFixedValue added in v0.6.0

func GenericUpdateFixedValue[T types.FixedSizeT](vec *movec.Vector, row uint32, v any)

func GetValue added in v0.6.0

func GetValue(col *movec.Vector, row uint32) any

func GetValueFrom

func GetValueFrom[T types.FixedSizeT](tool *CodecTool, i int) (v T)

func MockCompressedFile

func MockCompressedFile(buf []byte, osize int, algo int) common.IVFile

func MockVec added in v0.6.0

func MockVec(typ types.Type, rows int, offset int) *movec.Vector

func NewVector

func NewVector[T any](typ types.Type, nullable bool, opts ...Options) *vector[T]

func SplitBatch added in v0.6.0

func SplitBatch(bat *batch.Batch, cnt int) []*batch.Batch

func UnmarshalToMoVec added in v0.6.0

func UnmarshalToMoVec(vec Vector) (mov *movec.Vector)

func UnmarshalToMoVecs added in v0.6.0

func UnmarshalToMoVecs(vecs []Vector) []*movec.Vector

No copy

func UpdateValue added in v0.6.0

func UpdateValue(col *movec.Vector, row uint32, val any)

Types

type Batch

type Batch struct {
	Attrs   []string
	Vecs    []Vector
	Deletes *roaring.Bitmap
	// contains filtered or unexported fields
}

func BuildBatch

func BuildBatch(
	attrs []string,
	colTypes []types.Type,
	nullables []bool,
	opts Options) *Batch

func MockBatch

func MockBatch(vecTypes []types.Type, rows int, uniqueIdx int, provider *MockDataProvider) (bat *Batch)

func MockBatchWithAttrs

func MockBatchWithAttrs(vecTypes []types.Type, attrs []string, nullables []bool, rows int, uniqueIdx int, provider *MockDataProvider) (bat *Batch)

func MockNullableBatch

func MockNullableBatch(vecTypes []types.Type, nullables []bool, rows int, uniqueIdx int, provider *MockDataProvider) (bat *Batch)

func NewBatch

func NewBatch() *Batch

func NewEmptyBatch

func NewEmptyBatch() *Batch

func NewNonNullBatchWithSharedMemory added in v0.7.0

func NewNonNullBatchWithSharedMemory(b *batch.Batch) *Batch

func (*Batch) AddVector

func (bat *Batch) AddVector(attr string, vec Vector)

func (*Batch) Allocated

func (bat *Batch) Allocated() int

func (*Batch) Append added in v0.7.0

func (bat *Batch) Append(src *Batch) (err error)

func (*Batch) Capacity

func (bat *Batch) Capacity() int

func (*Batch) CloneWindow

func (bat *Batch) CloneWindow(offset, length int, allocator ...*mpool.MPool) (cloned *Batch)

func (*Batch) Close

func (bat *Batch) Close()

func (*Batch) Compact

func (bat *Batch) Compact()

func (*Batch) Delete

func (bat *Batch) Delete(i int)

func (*Batch) DeleteCnt

func (bat *Batch) DeleteCnt() int

func (*Batch) Equals

func (bat *Batch) Equals(o *Batch) bool

func (*Batch) Extend added in v0.6.0

func (bat *Batch) Extend(src *Batch)

extend vector with same name, consume src batch

func (*Batch) GetVectorByName

func (bat *Batch) GetVectorByName(name string) Vector

func (*Batch) HasDelete

func (bat *Batch) HasDelete() bool

func (*Batch) IsDeleted

func (bat *Batch) IsDeleted(i int) bool

func (*Batch) Length

func (bat *Batch) Length() int

func (*Batch) PPString added in v0.6.0

func (bat *Batch) PPString(num int) string

func (*Batch) RangeDelete

func (bat *Batch) RangeDelete(start, end int)

func (*Batch) ReadFrom

func (bat *Batch) ReadFrom(r io.Reader) (n int64, err error)

func (*Batch) Split

func (bat *Batch) Split(cnt int) []*Batch

func (*Batch) String

func (bat *Batch) String() string

func (*Batch) Window

func (bat *Batch) Window(offset, length int) *Batch

func (*Batch) WriteTo

func (bat *Batch) WriteTo(w io.Writer) (n int64, err error)

type Bytes

type Bytes = stl.Bytes

func FillBufferWithBytes

func FillBufferWithBytes(bs *Bytes, buffer *bytes.Buffer) *Bytes

type CodecTool

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

func NewCodecTool

func NewCodecTool() *CodecTool

func (*CodecTool) Allocated

func (tool *CodecTool) Allocated() int

func (*CodecTool) Close

func (tool *CodecTool) Close()

func (*CodecTool) Delete

func (tool *CodecTool) Delete(i int)

func (*CodecTool) Elements

func (tool *CodecTool) Elements() int

func (*CodecTool) Get

func (tool *CodecTool) Get(i int) []byte

func (*CodecTool) ReadFrom

func (tool *CodecTool) ReadFrom(r io.Reader) (n int64, err error)

func (*CodecTool) ReadFromFile

func (tool *CodecTool) ReadFromFile(f common.IVFile, buffer *bytes.Buffer) (err error)

func (*CodecTool) Reset

func (tool *CodecTool) Reset()

func (*CodecTool) Update

func (tool *CodecTool) Update(i int, buf []byte)

func (*CodecTool) Write

func (tool *CodecTool) Write(buf []byte) (n int, err error)

func (*CodecTool) WriteTo

func (tool *CodecTool) WriteTo(w io.Writer) (n int64, err error)

type ItOp

type ItOp = func(v any, row int) error

type MockDataProvider

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

func NewMockDataProvider

func NewMockDataProvider() *MockDataProvider

func (*MockDataProvider) AddColumnProvider

func (p *MockDataProvider) AddColumnProvider(colIdx int, provider Vector)

func (*MockDataProvider) GetColumnProvider

func (p *MockDataProvider) GetColumnProvider(colIdx int) Vector

func (*MockDataProvider) Reset

func (p *MockDataProvider) Reset()

type Options

type Options = containers.Options

type Vector

type Vector interface {
	VectorView
	Reset()
	ResetWithData(bs *Bytes, nulls *roaring64.Bitmap)
	GetView() VectorView
	Update(i int, v any)
	Delete(i int)
	Compact(*roaring.Bitmap)
	Append(v any)
	AppendMany(vs ...any)
	AppendNoNulls(s any)
	Extend(o Vector)
	ExtendWithOffset(src Vector, srcOff, srcLen int)
	CloneWindow(offset, length int, allocator ...*mpool.MPool) Vector

	Equals(o Vector) bool
	Window(offset, length int) Vector
	WriteTo(w io.Writer) (int64, error)
	ReadFrom(r io.Reader) (int64, error)

	ReadFromFile(common.IVFile, *bytes.Buffer) error

	Close()
}

func CloneWithBuffer

func CloneWithBuffer(src Vector, buffer *bytes.Buffer, allocator ...*mpool.MPool) (cloned Vector)

func MakeVector

func MakeVector(typ types.Type, nullable bool, opts ...Options) (vec Vector)

func MockVector

func MockVector(t types.Type, rows int, unique, nullable bool, provider Vector) (vec Vector)

func MockVector2

func MockVector2(typ types.Type, rows int, offset int) Vector

func MockVector3 added in v0.6.0

func MockVector3(typ types.Type, rows int) Vector

func NewVectorWithSharedMemory added in v0.6.0

func NewVectorWithSharedMemory(v *movec.Vector, nullable bool) Vector

type VectorView

type VectorView interface {
	IsView() bool
	Nullable() bool
	IsNull(i int) bool
	HasNull() bool
	NullMask() *roaring64.Bitmap

	Data() []byte
	Bytes() *Bytes
	Slice() any
	SlicePtr() unsafe.Pointer
	DataWindow(offset, length int) []byte
	Get(i int) any

	Length() int
	Capacity() int
	Allocated() int
	GetAllocator() *mpool.MPool
	GetType() types.Type
	String() string
	PPString(num int) string

	Foreach(op ItOp, sels *roaring.Bitmap) error
	ForeachWindow(offset, length int, op ItOp, sels *roaring.Bitmap) error

	WriteTo(w io.Writer) (int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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