Documentation
¶
Index ¶
- func NewAnd(left, right Node) *nodeAnd
- func NewNAnd(negative, regular Node) *nodeNAnd
- func NewNot(child Node, minID, maxID LID) *nodeNot
- func NewOr(left, right Node) *nodeOr
- func NewRange(minVal, maxVal LID) *nodeRange
- func OrMulti(batches []LIDBatch, asc bool) (result LIDBatch, residuals []LIDBatch)
- func TreeFold[V any](op func(V, V) V, def V, values []V) V
- type BatchedNode
- func EmptyBatched() BatchedNode
- func NewAndBatched(left, right BatchedNode, asc bool) BatchedNode
- func NewBatcherNode(source Node, asc bool) BatchedNode
- func NewNAndBatched(neg, reg BatchedNode, asc bool) BatchedNode
- func NewOrBatched(left, right BatchedNode, asc bool) BatchedNode
- func NewOrBatchedMulti(children []BatchedNode, asc bool) BatchedNode
- func NewStaticBatched(data []uint32, asc bool) BatchedNode
- type Iter
- type LID
- type LIDBatch
- func And(left, right LIDBatch, asc bool) (result, leftResidual, rightResidual LIDBatch)
- func AndNot(reg, neg LIDBatch, asc bool) (result, regResidual, negResidual LIDBatch)
- func EmptyBatch() LIDBatch
- func NewBitmapBatch(b *roaring.Bitmap) LIDBatch
- func NewBitmapBatchFromLids(lids []uint32) LIDBatch
- func NewSliceBatch(lids []uint32) LIDBatch
- func Or(left, right LIDBatch, asc bool) (result, leftResidual, rightResidual LIDBatch)
- type LIDsIter
- type ManyIter
- type Node
- type Sourced
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchedNode ¶ added in v0.72.0
type BatchedNode interface {
fmt.Stringer
// NextBatch returns next batch. Returns empty batch when exhausted.
NextBatch() LIDBatch
// NextBatchGeq returns next batch (LIDs >= minLID). Returns empty batch when exhausted.
NextBatchGeq(nextID LID) LIDBatch
}
func EmptyBatched ¶ added in v0.77.0
func EmptyBatched() BatchedNode
func NewAndBatched ¶ added in v0.77.0
func NewAndBatched(left, right BatchedNode, asc bool) BatchedNode
NewAndBatched returns a BatchedNode that intersects two batched iterators. asc is the LID traversal order for NextBatch / NextBatchGeq (true = low to high).
func NewBatcherNode ¶ added in v0.77.0
func NewBatcherNode(source Node, asc bool) BatchedNode
func NewNAndBatched ¶ added in v0.77.0
func NewNAndBatched(neg, reg BatchedNode, asc bool) BatchedNode
NewNAndBatched returns a BatchedNode that computes AND NOT of two batched iterators. asc is the LID traversal order for NextBatch / NextBatchGeq (true = low to high).
func NewOrBatched ¶ added in v0.77.0
func NewOrBatched(left, right BatchedNode, asc bool) BatchedNode
NewOrBatched returns a BatchedNode that unions two batched iterators. asc is the LID traversal order for NextBatch / NextBatchGeq (true = low to high).
func NewOrBatchedMulti ¶ added in v0.77.0
func NewOrBatchedMulti(children []BatchedNode, asc bool) BatchedNode
func NewStaticBatched ¶ added in v0.77.0
func NewStaticBatched(data []uint32, asc bool) BatchedNode
NewStaticBatched returns a BatchedNode over sorted LID data.
type LID ¶ added in v0.69.0
type LID struct {
// contains filtered or unexported fields
}
LID is an encoded representation of LID and order flag made specifically for fast compare operations.
For asc LID order the value is stored as is and mask is zero. For desc LID order the value is inverted as follows: "MaxUint32 - LID" formula using XOR mask. Terminal LID value is 0 instead of MaxUint32 in desc order, but 0 is XORed to MaxUint32. Which means, null value will always have lid field set to 0xFFFFFFFF (math.MaxUint32) regardless of order flag.
func NewAscZeroLID ¶ added in v0.72.0
func NewAscZeroLID() LID
func NewDescLID ¶ added in v0.69.0
NewDescLID returns LIDs for desc LID order.
func NewDescZeroLID ¶ added in v0.72.0
func NewDescZeroLID() LID
type LIDBatch ¶ added in v0.72.0
type LIDBatch interface {
Len() int
IsEmpty() bool
// Min returns minimum (first) value. Panics if batch is empty.
Min() uint32
// Max returns max (last) value. Panics if batch is empty.
Max() uint32
ManyIter(asc bool) ManyIter
// Iter iterates lids in ascending way.
Iter() Iter
// ReverseIter iterates lids in descending way.
ReverseIter() Iter
// Narrow returns a batch containing only LIDs from minLID to maxLID (inclusive both).
Narrow(minLID, maxLID uint32) LIDBatch
}
LIDBatch is batch of lids. It's immutable and can not be modified. Lids are always sorted in ascending way for every underlying implementation.
func And ¶ added in v0.77.0
And intersects two batches in the given LID order and returns result and unprocessed parts (either left or right will be empty). For AND operation left and right residuals are equal to provided left or right batch, it's safe.
func AndNot ¶ added in v0.77.0
AndNot finds "AND NOT" result for two batches and returns result and unprocessed parts.
func EmptyBatch ¶ added in v0.77.0
func EmptyBatch() LIDBatch
func NewBitmapBatch ¶ added in v0.77.0
func NewBitmapBatchFromLids ¶ added in v0.77.0
func NewSliceBatch ¶ added in v0.77.0
type Node ¶
type Node interface {
fmt.Stringer // for testing
Next() LID
// NextGeq returns next greater or equal (GEQ) lid
NextGeq(nextID LID) LID
}
func BuildORTree ¶
func MakeStaticNodes ¶
MakeStaticNodes is currently used only for tests
type Sourced ¶
type Sourced interface {
fmt.Stringer // for testing
// aggregation need source
NextSourced() (id LID, source uint32)
NextSourcedGeq(nextLID LID) (id LID, source uint32)
// Release releases resources held by the sourced node (e.g. pooled buffers).
Release()
}