Documentation ¶
Index ¶
- func Memclr(b []uint16)
- type Bitmap
- func And(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 (ra *Bitmap) And(bm *Bitmap)
- func (ra *Bitmap) AndNot(bm *Bitmap)
- func (ra *Bitmap) Capacity() int
- func (ra *Bitmap) Cleanup()
- func (ra *Bitmap) Clone() *Bitmap
- func (ra *Bitmap) Contains(x uint64) bool
- 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 (dst *Bitmap) Or(src *Bitmap)
- 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 (ra *Bitmap) Size() int
- 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) Capacity ¶
Capacity returns the underlying arrays uint16 capacity. used to reduce amount of reallocations.
func (*Bitmap) GetCardinality ¶
func (*Bitmap) ManyIterator ¶
TODO: See if this is needed, we should remove this
func (*Bitmap) NewIterator ¶
func (*Bitmap) NewRangeIterators ¶
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.