bitmapdb

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkLimit = uint64(1950 * datasize.B) // threshold beyond which MDBX overflow pages appear: 4096 / 2 - (keySize + 8)

Variables

This section is empty.

Functions

func CutLeft

func CutLeft(bm *roaring.Bitmap, sizeLimit uint64) *roaring.Bitmap

CutLeft - cut from bitmap `targetSize` bytes from left removing lft part from `bm` returns nil on zero cardinality

func CutLeft64

func CutLeft64(bm *roaring64.Bitmap, sizeLimit uint64) *roaring64.Bitmap

CutLeft - cut from bitmap `targetSize` bytes from left removing lft part from `bm` returns nil on zero cardinality

func Get

func Get(db kv.Tx, bucket string, key []byte, from, to uint32) (*roaring.Bitmap, error)

Get - reading as much chunks as needed to satisfy [from, to] condition join all chunks to 1 bitmap by Or operator

func Get64

func Get64(db kv.Tx, bucket string, key []byte, from, to uint64) (*roaring64.Bitmap, error)

Get - reading as much chunks as needed to satisfy [from, to] condition join all chunks to 1 bitmap by Or operator

func NewBitmap

func NewBitmap() *roaring.Bitmap

func NewBitmap64

func NewBitmap64() *roaring64.Bitmap

func ReturnToPool

func ReturnToPool(a *roaring.Bitmap)

func ReturnToPool64

func ReturnToPool64(a *roaring64.Bitmap)

func SeekInBitmap

func SeekInBitmap(m *roaring.Bitmap, n uint32) (found uint32, ok bool)

SeekInBitmap - returns value in bitmap which is >= n

func SeekInBitmap64

func SeekInBitmap64(m *roaring64.Bitmap, n uint64) (found uint64, ok bool)

SeekInBitmap - returns value in bitmap which is >= n

func TruncateRange

func TruncateRange(db kv.RwTx, bucket string, key []byte, to uint32) error

TruncateRange - gets existing bitmap in db and call RemoveRange operator on it. starts from hot shard, stops when shard not overlap with [from-to) !Important: [from, to)

func TruncateRange64

func TruncateRange64(db kv.RwTx, bucket string, key []byte, to uint64) error

TruncateRange - gets existing bitmap in db and call RemoveRange operator on it. starts from hot shard, stops when shard not overlap with [from-to) !Important: [from, to)

func WalkChunkWithKeys

func WalkChunkWithKeys(k []byte, m *roaring.Bitmap, sizeLimit uint64, f func(chunkKey []byte, chunk *roaring.Bitmap) error) error

func WalkChunkWithKeys64

func WalkChunkWithKeys64(k []byte, m *roaring64.Bitmap, sizeLimit uint64, f func(chunkKey []byte, chunk *roaring64.Bitmap) error) error

func WalkChunks

func WalkChunks(bm *roaring.Bitmap, sizeLimit uint64, f func(chunk *roaring.Bitmap, isLast bool) error) error

func WalkChunks64

func WalkChunks64(bm *roaring64.Bitmap, sizeLimit uint64, f func(chunk *roaring64.Bitmap, isLast bool) error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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