class

LexisMinhash::LinearBucketTable

Inherits Reference < Object

LinearBucketTable is a simple open-addressing hash table with linear probing. It stores BucketEntry values and is used by each LSH band to record document ids for a given band hash.

Constructors

new(capacity : Int32)

Capacity should be ~2x expected entries for good performance Create a table with capacity slots

Source

Instance methods

capacity

Total capacity (number of slots)

Source
clear

Clear the table, marking all slots as empty

Source
find_candidates(key : UInt64, &) : Nil

Iterate candidate doc ids matching the given key by scanning the cluster.

Source
insert(key : UInt64, doc_id : Int32) : Nil

Insert a key/doc_id pair into the table. No-op if the table is full or the pair already exists.

Source
load_factor

Load factor (occupied / capacity)

Source
size

Number of occupied entries

Source