Class: BucketSelector

BucketSelector

new BucketSelector()

Bucket selector interface.
Source:

Methods

<inner> Selector(seed, item) → {number[]}

Selects buckets to store items in.

This interface leaks internal details about summary structure. One can implement and use custom instances to customize settings but be ready for major changes in following versions.

The output array must contain integers between 0 and Integer.MAX_VALUE. It is better if all integers in that range have the same probability of appearance.

The output must be consistent, for any byte arraycontent, for any positive integer b, multiple invocations of selectBuckets(b, content) must return the same array.

Different seed values should lead to different resulting arrays.

The number of returned buckets may vary for different contents and the returned array may contain duplicates.

Parameters:
Name Type Description
seed number a seed preventing items to fall in the same buckets at all compression levels.
item external:ArrayBuffer the item to serialize.
Source:
Returns:
buckets to store the item in.
Type
number[]