Documentation
¶
Index ¶
- func Memclr(b []uint16)
- type Bitmap
- func And(a, b *Bitmap) *Bitmap
- func AndBuf(a, b *Bitmap, buf []uint16) *Bitmap
- func AndNot(a, b *Bitmap) *Bitmap
- func AndNotBuf(a, b *Bitmap, buf []uint16) *Bitmap
- func AndOld(a, b *Bitmap) *Bitmap
- func FastAnd(bitmaps ...*Bitmap) *Bitmap
- func FastOr(bitmaps ...*Bitmap) *Bitmap
- func FastParOr(numGo int, bitmaps ...*Bitmap) *Bitmap
- func FromBuffer(data []byte) *Bitmap
- func FromBufferWithCopy(src []byte) *Bitmap
- func FromSortedList(vals []uint64) *Bitmap
- func NewBitmap() *Bitmap
- func NewBitmapWith(numKeys int) *Bitmap
- func Or(a, b *Bitmap) *Bitmap
- func OrBuf(a, b *Bitmap, buf []uint16) *Bitmap
- func OrOld(a, b *Bitmap) *Bitmap
- func (ra *Bitmap) And(bm *Bitmap) *Bitmap
- func (ra *Bitmap) AndBuf(bm *Bitmap, buf []uint16) *Bitmap
- func (ra *Bitmap) AndNot(bm *Bitmap) *Bitmap
- func (ra *Bitmap) AndNotBuf(bm *Bitmap, buf []uint16) *Bitmap
- func (ra *Bitmap) AndNotOld(bm *Bitmap)
- func (dst *Bitmap) AndNotToSuperset(src *Bitmap, containerBufs ...[]uint16)
- func (ra *Bitmap) AndOld(bm *Bitmap)
- func (dst *Bitmap) AndToSuperset(src *Bitmap, containerBufs ...[]uint16)
- func (ra *Bitmap) Cleanup()
- func (ra *Bitmap) Clone() *Bitmap
- func (ra *Bitmap) Contains(x uint64) bool
- func (ra *Bitmap) ConvertToBitmapContainers()
- func (ra *Bitmap) Debug(x uint64) string
- func (ra *Bitmap) GetCardinality() int
- func (ra *Bitmap) IsEmpty() bool
- func (r *Bitmap) ManyIterator() *ManyItr
- func (ra *Bitmap) Maximum() uint64
- func (ra *Bitmap) Minimum() uint64
- func (bm *Bitmap) NewIterator() *Iterator
- func (bm *Bitmap) NewRangeIterators(numRanges int) []*Iterator
- func (ra *Bitmap) Or(bm *Bitmap) *Bitmap
- func (ra *Bitmap) OrBuf(bm *Bitmap, buf []uint16) *Bitmap
- func (dst *Bitmap) OrOld(src *Bitmap)
- func (dst *Bitmap) OrToSuperset(src *Bitmap, containerBufs ...[]uint16)
- func (ra *Bitmap) Rank(x uint64) int
- func (ra *Bitmap) Remove(x uint64) bool
- func (ra *Bitmap) RemoveRange(lo, hi uint64)
- func (ra *Bitmap) Reset()
- func (ra *Bitmap) Select(x uint64) (uint64, error)
- func (ra *Bitmap) Set(x uint64) bool
- func (ra *Bitmap) SetMany(vals []uint64)
- func (bm *Bitmap) Split(externalSize func(start, end uint64) uint64, maxSz uint64) []*Bitmap
- func (ra *Bitmap) String() string
- func (ra *Bitmap) ToArray() []uint64
- func (ra *Bitmap) ToBuffer() []byte
- func (ra *Bitmap) ToBufferWithCopy() []byte
- type Iterator
- type ManyItr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
func FastOr ¶
FastOr would merge given Bitmaps into one Bitmap. This is faster than doing an OR over the bitmaps iteratively.
func FastParOr ¶
FastParOr would group up bitmaps and call FastOr on them concurrently. It would then merge the groups into final Bitmap. This approach is simpler and faster than operating at a container level, because we can't operate on array containers belonging to the same Bitmap concurrently because array containers can expand, leaving no clear boundaries.
If FastParOr is called with numGo=1, it just calls FastOr.
Experiments with numGo=4 shows that FastParOr would be 2x the speed of FastOr, but 4x the memory usage, even under 50% CPU usage. So, use wisely.
func FromBuffer ¶
FromBuffer returns a pointer to bitmap corresponding to the given buffer. This bitmap shouldn't be modified because it might corrupt the given buffer.
func FromBufferWithCopy ¶
FromBufferWithCopy creates a copy of the given buffer and returns a bitmap based on the copied buffer. This bitmap is safe for both read and write operations.
func FromSortedList ¶
func NewBitmapWith ¶
func (*Bitmap) AndNotToSuperset ¶ added in v0.0.3
AndNotToSuperset calculates difference between current and incoming bitmap It reuses containers present in current bitmap and utilize containers buffers provided. Number of passed buffers indicates concurrency level (e.g. 4 buffers = merge will be performed by 4 goroutines).
CAUTION: should be used only when current bitmap contained before all elements present in incoming bitmap
func (*Bitmap) AndToSuperset ¶ added in v0.0.3
AndToSuperset calculates intersection of current and incoming bitmap It reuses containers present in current bitmap and utilize container buffers provided. Number of passed buffers indicates concurrency level (e.g. 4 buffers = merge will be performed by 4 goroutines).
CAUTION: should be used only when current bitmap contained before all elements present in incoming bitmap
func (*Bitmap) ConvertToBitmapContainers ¶ added in v0.0.3
func (ra *Bitmap) ConvertToBitmapContainers()
func (*Bitmap) GetCardinality ¶
func (*Bitmap) ManyIterator ¶
TODO: See if this is needed, we should remove this
func (*Bitmap) NewIterator ¶
func (*Bitmap) NewRangeIterators ¶
func (*Bitmap) OrToSuperset ¶ added in v0.0.3
OrToSuperset calculates union of current and incoming bitmap It reuses containers present in current bitmap and utilize containers buffers provided. Number of passed buffers indicates concurrency level (e.g. 4 buffers = merge will be performed by 4 goroutines).
CAUTION: should be used only when current bitmap contained before all elements present in incoming bitmap
func (*Bitmap) RemoveRange ¶
Remove range removes [lo, hi) from the bitmap.
func (*Bitmap) Split ¶
Split splits the bitmap based on maxSz and the externalSize function. It splits the bitmap such that size of each split bitmap + external size corresponding to its elements approximately equal to maxSz (it can be greater than maxSz sometimes). The splits are returned in sorted order. externalSize is a function that should return the external size corresponding to elements in range [start, end]. External size is used to calculate the split boundaries.