public static interface KeySelector.WordSelector
Word selectors are used to determine which words (multi-bit groups) in a key should be examined or set when performing Bloom filter operations. Each word offset represents a specific word position within the key that corresponds to a hash function's target in the filter's word array.
Word selection is complementary to bit selection - while bit selectors identify individual bit positions, word selectors identify groups of bits (words) that can be processed more efficiently in some Bloom filter implementations. The word size is determined by the filter's m parameter (filter size as power of 2).
The word selection algorithm extracts k word positions from key data, where each word position corresponds to a specific hash function's target word in filter's word array. This enables efficient mapping from key data to Bloom filter word positions.
Implementations must be thread-safe as they may be used concurrently by multiple threads accessing the same Bloom filter.
| Modifier and Type | Method and Description |
|---|---|
void |
getWordSelectors(byte[] b,
int offset,
int length,
int[] wordOffset)
Extracts k word offsets from a key for Bloom filter operations.
|
void getWordSelectors(byte[] b,
int offset,
int length,
int[] wordOffset)
This method populates the provided wordOffset array with k integer values, each representing a word position within the key that should be used by a hash function. The word positions are calculated based on key data and the specific word selection algorithm.
The offset and length parameters allow processing of subsets of key data, enabling flexible key handling for different key sizes and Bloom filter configurations. The word size is determined by (m-5) where m is the filter size parameter.
b - key data as byte arrayoffset - starting position within the key arraylength - number of bytes to process from the keywordOffset - output array of length k to store calculated word offsets