Documentation
      ¶
    
    
  
    
  
    Index ¶
- func ForeachVector(vec Vector, op any, sel *nulls.Bitmap) (err error)
 - func ForeachVectorWindow(vec Vector, start, length int, op1 any, op2 ItOp, sel *nulls.Bitmap) (err error)
 - func ForeachWindowBytes(vec *movec.Vector, start, length int, op ItOpT[[]byte], sels *nulls.Bitmap) (err error)
 - func ForeachWindowFixed[T any](vec *movec.Vector, start, length int, op ItOpT[T], opAny ItOp, ...) (err error)
 - func ForeachWindowVarlen(vec *movec.Vector, start, length int, op ItOpT[[]byte], opAny ItOp, ...) (err error)
 - func GenericUpdateBytes(vec *movec.Vector, row uint32, v any, isNull bool, mp *mpool.MPool)
 - func GenericUpdateFixedValue[T types.FixedSizeT](vec *movec.Vector, row uint32, v any, isNull bool, _ *mpool.MPool)
 - func GetDefaultVectorPoolALLocator() *mpool.MPool
 - func MakeForeachVectorOp(t types.T, overloads map[types.T]any, args ...any) any
 - func NewConstBytes(typ types.Type, val []byte, length int, opts ...Options) *vectorWrapper
 - func NewConstFixed[T any](typ types.Type, val T, length int, opts ...Options) *vectorWrapper
 - func NewConstNullVector(typ types.Type, length int, mp *mpool.MPool) *vectorWrapper
 - func NewVector(typ types.Type, opts ...Options) *vectorWrapper
 - func SplitBatch(bat *batch.Batch, cnt int) []*batch.Batch
 - func ToCNBatch(tnBat *Batch) *batch.Batch
 - func UpdateValue(col *movec.Vector, row uint32, val any, isNull bool, mp *mpool.MPool)
 - type BaseView
 - type Batch
 - func BuildBatch(attrs []string, colTypes []types.Type, opts Options) *Batch
 - func BuildBatchWithPool(attrs []string, colTypes []types.Type, capacity int, pool *VectorPool) *Batch
 - func MockBatch(vecTypes []types.Type, rows int, uniqueIdx int, provider *MockDataProvider) (bat *Batch)
 - func MockBatchWithAttrs(vecTypes []types.Type, attrs []string, rows int, uniqueIdx int, ...) (bat *Batch)
 - func MockNullableBatch(vecTypes []types.Type, rows int, uniqueIdx int, provider *MockDataProvider) (bat *Batch)
 - func NewBatch() *Batch
 - func NewBatchWithCapacity(cap int) *Batch
 - func NewEmptyBatch() *Batch
 - func NewNonNullBatchWithSharedMemory(b *batch.Batch, mp *mpool.MPool) *Batch
 - func ToTNBatch(cnBat *batch.Batch, mp *mpool.MPool) *Batch
 
- func (bat *Batch) AddVector(attr string, vec Vector)
 - func (bat *Batch) Allocated() int
 - func (bat *Batch) Append(src *Batch) (err error)
 - func (bat *Batch) AppendPlaceholder()
 - func (bat *Batch) ApproxSize() int
 - func (bat *Batch) CloneWindow(offset, length int, allocator ...*mpool.MPool) (cloned *Batch)
 - func (bat *Batch) CloneWindowWithPool(offset, length int, pool *VectorPool) (cloned *Batch)
 - func (bat *Batch) Close()
 - func (bat *Batch) Compact()
 - func (bat *Batch) Delete(i int)
 - func (bat *Batch) DeleteCnt() int
 - func (bat *Batch) Equals(o *Batch) bool
 - func (bat *Batch) Extend(src *Batch)
 - func (bat *Batch) GetVectorByName(name string) Vector
 - func (bat *Batch) HasDelete() bool
 - func (bat *Batch) IsDeleted(i int) bool
 - func (bat *Batch) Length() int
 - func (bat *Batch) PPString(num int) string
 - func (bat *Batch) RangeDelete(start, end int)
 - func (bat *Batch) ReadFrom(r io.Reader) (n int64, err error)
 - func (bat *Batch) ReadFromV1(r io.Reader) (n int64, err error)
 - func (bat *Batch) Reset()
 - func (bat *Batch) Split(cnt int) []*Batch
 - func (bat *Batch) String() string
 - func (bat *Batch) Window(offset, length int) *Batch
 - func (bat *Batch) WindowDeletes(offset, length int, deep bool) *nulls.Bitmap
 - func (bat *Batch) WriteTo(w io.Writer) (n int64, err error)
 
- type BatchSplitter
 - type BatchWithVersion
 - type BlockView
 - func (view *BlockView) ApplyDeletes()
 - func (view *BlockView) ApproxSize() (size int)
 - func (view *BlockView) Close()
 - func (view *BlockView) GetColumnData(i int) Vector
 - func (view *BlockView) Orphan(i int) Vector
 - func (view *BlockView) SetBatch(bat *Batch)
 - func (view *BlockView) SetData(i int, data Vector)
 
- type ColumnView
 - func (view *ColumnView) ApplyDeletes() Vector
 - func (view *ColumnView) Close()
 - func (view *ColumnView) GetData() Vector
 - func (view *ColumnView) GetValue(row int) (any, bool)
 - func (view *ColumnView) IsDeleted(row int) bool
 - func (view *ColumnView) Length() int
 - func (view *ColumnView) Orphan() Vector
 - func (view *ColumnView) SetData(data Vector)
 - func (view *ColumnView) String() string
 
- type ItOp
 - type ItOpT
 - type MockDataProvider
 - type Options
 - type Vector
 - func CloneVector(src *movec.Vector, mp *mpool.MPool, vp *VectorPool) (Vector, error)
 - func MakeVector(typ types.Type, mp *mpool.MPool) (vec Vector)
 - func MockVector(t types.Type, rows int, unique bool, provider Vector) (vec Vector)
 - func MockVector2(typ types.Type, rows int, offset int) Vector
 - func ToTNVector(v *movec.Vector, mp *mpool.MPool) Vector
 
- type VectorPool
 - func (p *VectorPool) Allocated() int
 - func (p *VectorPool) Destory()
 - func (p *VectorPool) FixedSizeAllocated() int
 - func (p *VectorPool) FixedSizeUsed(isUnsafe bool) (int, int)
 - func (p *VectorPool) GetMPool() *mpool.MPool
 - func (p *VectorPool) GetVector(t *types.Type) *vectorWrapper
 - func (p *VectorPool) String() string
 - func (p *VectorPool) Used(isUnsafe bool) (int, int)
 - func (p *VectorPool) VarlenUsed(isUnsafe bool) (int, int)
 - func (p *VectorPool) VarlenaSizeAllocated() int
 
- type VectorPoolOption
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForeachVector ¶ added in v0.8.0
func ForeachVectorWindow ¶ added in v0.8.0
func ForeachWindowBytes ¶ added in v0.8.0
func ForeachWindowFixed ¶ added in v0.8.0
func ForeachWindowVarlen ¶ added in v0.8.0
func GenericUpdateBytes ¶ added in v0.6.0
func GenericUpdateFixedValue ¶ added in v0.6.0
func GetDefaultVectorPoolALLocator ¶ added in v1.0.0
func MakeForeachVectorOp ¶ added in v0.8.0
func NewConstBytes ¶ added in v1.0.0
func NewConstFixed ¶ added in v1.0.0
func NewConstNullVector ¶ added in v1.0.0
Types ¶
type Batch ¶
type Batch struct {
	Attrs   []string
	Vecs    []Vector
	Deletes *nulls.Bitmap
	Nameidx map[string]int
	Pool    *VectorPool
}
    func BuildBatchWithPool ¶ added in v0.8.0
func MockBatchWithAttrs ¶
func MockNullableBatch ¶
func NewBatchWithCapacity ¶ added in v0.8.0
func NewEmptyBatch ¶
func NewEmptyBatch() *Batch
func NewNonNullBatchWithSharedMemory ¶ added in v0.7.0
func (*Batch) AppendPlaceholder ¶ added in v0.8.0
func (bat *Batch) AppendPlaceholder()
AddPlaceholder is used to consctruct batch sent to CN. The vectors in the batch are sorted by seqnum, if the seqnum was dropped, a zero value will be fill as placeholder. This is space-time tradeoff.
func (*Batch) ApproxSize ¶ added in v1.0.0
func (*Batch) CloneWindow ¶
func (*Batch) CloneWindowWithPool ¶ added in v0.8.0
func (bat *Batch) CloneWindowWithPool(offset, length int, pool *VectorPool) (cloned *Batch)
func (*Batch) GetVectorByName ¶
func (*Batch) RangeDelete ¶
func (*Batch) ReadFromV1 ¶ added in v0.8.0
in version1, batch.Deletes is roaring.Bitmap
func (*Batch) WindowDeletes ¶ added in v0.8.0
type BatchSplitter ¶ added in v1.0.0
type BatchSplitter struct {
	// contains filtered or unexported fields
}
    BatchSplitter is used to split a batch into several batches with the same size.
func NewBatchSplitter ¶ added in v1.0.0
func NewBatchSplitter(bat *Batch, sliceSize int) *BatchSplitter
func (*BatchSplitter) Next ¶ added in v1.0.0
func (bs *BatchSplitter) Next() (*Batch, error)
type BatchWithVersion ¶ added in v0.8.0
func (*BatchWithVersion) Len ¶ added in v0.8.0
func (b *BatchWithVersion) Len() int
func (*BatchWithVersion) Less ¶ added in v0.8.0
func (b *BatchWithVersion) Less(i, j int) bool
Sort by seqnum
func (*BatchWithVersion) Swap ¶ added in v0.8.0
func (b *BatchWithVersion) Swap(i, j int)
type BlockView ¶ added in v0.8.0
type BlockView struct {
	*BaseView
	Columns map[int]*ColumnView
}
    TODO: remove this BlockView later Use Batch instead
func NewBlockView ¶ added in v0.8.0
func NewBlockView() *BlockView
func (*BlockView) ApplyDeletes ¶ added in v0.8.0
func (view *BlockView) ApplyDeletes()
func (*BlockView) ApproxSize ¶ added in v1.0.0
func (*BlockView) GetColumnData ¶ added in v0.8.0
type ColumnView ¶ added in v0.8.0
TODO: remove this ColumnView later Use Batch with one vector instead
func NewColumnView ¶ added in v0.8.0
func NewColumnView(colIdx int) *ColumnView
func (*ColumnView) ApplyDeletes ¶ added in v0.8.0
func (view *ColumnView) ApplyDeletes() Vector
func (*ColumnView) Close ¶ added in v0.8.0
func (view *ColumnView) Close()
func (*ColumnView) GetData ¶ added in v0.8.0
func (view *ColumnView) GetData() Vector
func (*ColumnView) IsDeleted ¶ added in v0.8.0
func (view *ColumnView) IsDeleted(row int) bool
func (*ColumnView) Length ¶ added in v0.8.0
func (view *ColumnView) Length() int
func (*ColumnView) Orphan ¶ added in v0.8.0
func (view *ColumnView) Orphan() Vector
func (*ColumnView) SetData ¶ added in v0.8.0
func (view *ColumnView) SetData(data Vector)
func (*ColumnView) String ¶ added in v0.8.0
func (view *ColumnView) String() string
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 Vector ¶
type Vector interface {
	GetType() *types.Type
	IsConst() bool
	IsConstNull() bool
	// Deep copy ops
	Get(i int) any
	Append(v any, isNull bool)
	CloneWindow(offset, length int, allocator ...*mpool.MPool) Vector
	CloneWindowWithPool(offset, length int, pool *VectorPool) Vector
	PreExtend(length int) error
	WriteTo(w io.Writer) (int64, error)
	ReadFrom(r io.Reader) (int64, error)
	// Shallow Ops
	ShallowGet(i int) any
	Window(offset, length int) Vector
	// Deepcopy if const
	TryConvertConst() Vector
	GetDownstreamVector() *cnVector.Vector
	Update(i int, v any, isNull bool)
	Compact(*roaring.Bitmap)
	CompactByBitmap(*nulls.Bitmap)
	Extend(o Vector)
	ExtendWithOffset(src Vector, srcOff, srcLen int)
	ExtendVec(o *cnVector.Vector) error
	Foreach(op ItOp, sels *nulls.Bitmap) error
	ForeachWindow(offset, length int, op ItOp, sels *nulls.Bitmap) error
	Length() int
	ApproxSize() int
	Allocated() int
	GetAllocator() *mpool.MPool
	IsNull(i int) bool
	HasNull() bool
	NullMask() *nulls.Nulls
	// NullCount will consider ConstNull and Const vector
	NullCount() int
	Close()
	// Test functions
	Equals(o Vector) bool
	String() string
	PPString(num int) string
	AppendMany(vs []any, isNulls []bool)
	Delete(i int)
	// contains filtered or unexported methods
}
    var EMPTY_VECTOR Vector
    func CloneVector ¶ added in v1.2.0
func MockVector ¶
type VectorPool ¶ added in v0.8.0
type VectorPool struct {
	// contains filtered or unexported fields
}
    func NewVectorPool ¶ added in v0.8.0
func NewVectorPool(name string, cnt int, opts ...VectorPoolOption) *VectorPool
func (*VectorPool) Allocated ¶ added in v0.8.0
func (p *VectorPool) Allocated() int
func (*VectorPool) Destory ¶ added in v1.0.0
func (p *VectorPool) Destory()
Only for test It is not safe to call Destory
func (*VectorPool) FixedSizeAllocated ¶ added in v0.8.0
func (p *VectorPool) FixedSizeAllocated() int
func (*VectorPool) FixedSizeUsed ¶ added in v0.8.0
func (p *VectorPool) FixedSizeUsed(isUnsafe bool) (int, int)
func (*VectorPool) GetMPool ¶ added in v1.2.0
func (p *VectorPool) GetMPool() *mpool.MPool
func (*VectorPool) GetVector ¶ added in v0.8.0
func (p *VectorPool) GetVector(t *types.Type) *vectorWrapper
func (*VectorPool) String ¶ added in v0.8.0
func (p *VectorPool) String() string
func (*VectorPool) VarlenUsed ¶ added in v0.8.0
func (p *VectorPool) VarlenUsed(isUnsafe bool) (int, int)
func (*VectorPool) VarlenaSizeAllocated ¶ added in v0.8.0
func (p *VectorPool) VarlenaSizeAllocated() int
type VectorPoolOption ¶ added in v0.8.0
type VectorPoolOption func(*VectorPool)
func WithAllocationLimit ¶ added in v0.8.0
func WithAllocationLimit(maxv int) VectorPoolOption
func WithFixedSizeRatio ¶ added in v0.8.0
func WithFixedSizeRatio(ratio float64) VectorPoolOption
func WithMPool ¶ added in v0.8.0
func WithMPool(mp *mpool.MPool) VectorPoolOption
 Click to show internal directories. 
   Click to hide internal directories.