batch

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(bat *Batch, m *mheap.Mheap)

func Cow

func Cow(bat *Batch)

func GetVector

func GetVector(bat *Batch, name string) *vector.Vector

func GetVectorIndex

func GetVectorIndex(bat *Batch, name string) int

func Length

func Length(bat *Batch) int

func Prefetch

func Prefetch(bat *Batch, attrs []string, vecs []*vector.Vector)

func Reduce

func Reduce(bat *Batch, attrs []string, m *mheap.Mheap)

func Reorder

func Reorder(bat *Batch, attrs []string)

func SetLength

func SetLength(bat *Batch, n int)

func Shrink

func Shrink(bat *Batch, sels []int64)

func Shuffle

func Shuffle(bat *Batch, m *mheap.Mheap) error

Types

type Batch

type Batch struct {
	// Ro if true, Attrs is read only
	Ro bool
	// reference count, default is 1
	Cnt int64
	// SelsData encoded row number list
	SelsData []byte
	// Sels row number list
	Sels []int64
	// Attrs column name list
	Attrs []string
	// Vecs col data
	Vecs []*vector.Vector
	// ring
	Zs     []int64
	As     []string // alias list
	Refs   []uint64 // reference count
	Rs     []ring.Ring
	Ht     interface{} // hash table
	Result *DumpResult
}

Batch represents a part of a relationship including an optional list of row numbers, columns and list of attributes

(SelsData, Sels) - list of row numbers
(Attrs) - list of attributes
(vecs) 	- columns

func New

func New(ro bool, attrs []string) *Batch

func NewWithSize added in v0.5.0

func NewWithSize(n int) *Batch

func (*Batch) Append

func (bat *Batch) Append(mh *mheap.Mheap, b *Batch) (*Batch, error)

func (*Batch) Clean added in v0.5.0

func (bat *Batch) Clean(m *mheap.Mheap)

func (*Batch) ExpandNulls added in v0.5.1

func (bat *Batch) ExpandNulls()

func (*Batch) GetVector added in v0.5.0

func (bat *Batch) GetVector(pos int32) *vector.Vector

func (*Batch) InitZsOne

func (bat *Batch) InitZsOne(len int)

InitZsOne init Batch.Zs and values are all 1

func (*Batch) Length added in v0.5.0

func (bat *Batch) Length() int

func (*Batch) Prefetch added in v0.5.0

func (bat *Batch) Prefetch(poses []int32, vecs []*vector.Vector)

func (*Batch) Shrink added in v0.5.0

func (bat *Batch) Shrink(sels []int64)

func (*Batch) Shuffle added in v0.5.0

func (bat *Batch) Shuffle(sels []int64, m *mheap.Mheap) error

func (*Batch) String

func (bat *Batch) String() string

type DecodeItem

type DecodeItem struct {
	// Attrs column name list
	Attrs []string
	// column data, origin Data
	Vecs []DumpDecodeItem
}

type DumpDecodeItem

type DumpDecodeItem []interface{}

type DumpKey

type DumpKey []byte

type DumpOption

type DumpOption struct {
	Db_name       []string
	Table_name    []string
	Keys          bool
	Values        bool
	Decode_key    bool
	Decode_value  bool
	Limit         []uint64
	Filename      string
	Max_file_size int64
	Writer        *bufio.Writer
	PrimaryKey    []byte
	ReadCnt       uint64
	UseKey        bool
	PrimaryValue  []string
	UseValue      bool
}

type DumpResult

type DumpResult struct {
	Keys          []DumpKey
	Values        []DumpValue
	Decode_keys   DecodeItem
	Decode_values DecodeItem
}

type DumpValue

type DumpValue []byte

Jump to

Keyboard shortcuts

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