containers

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAllocator = stl.DefaultAllocator
View Source
var NewBytes = stl.NewBytes

Functions

func ApplyUpdates

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

func GetValueFrom

func GetValueFrom[T any](tool *CodecTool, i int) (v T)

func MockCompressedFile

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

func NewVector

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

func WriteValueInto

func WriteValueInto[T any](tool *CodecTool, v T) (n int64, err error)

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,
	capacity int) *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 (*Batch) AddVector

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

func (*Batch) Allocated

func (bat *Batch) Allocated() int

func (*Batch) Capacity

func (bat *Batch) Capacity() int

func (*Batch) CloneWindow

func (bat *Batch) CloneWindow(offset, length int, allocator ...MemAllocator) (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) 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) 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 MemAllocator

type MemAllocator = stl.MemAllocator

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)
	DeleteBatch(*roaring.Bitmap)
	Append(v any)
	AppendMany(vs ...any)
	AppendNoNulls(s any)
	Extend(o Vector)
	ExtendWithOffset(src Vector, srcOff, srcLen int)
	Compact(deletes *roaring.Bitmap)
	CloneWindow(offset, length int, allocator ...MemAllocator) 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 ...MemAllocator) (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

type VectorView

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

	Data() []byte
	Bytes() *Bytes
	Slice() any
	DataWindow(offset, length int) []byte
	Get(i int) any
	GetCopy(i int) any

	Length() int
	Capacity() int
	Allocated() int
	GetAllocator() stl.MemAllocator
	GetType() types.Type
	String() 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