HllOp
in package
HyperLogLog (HLL) operations.
Requires server versions >= 4.9.
HyperLogLog operations on HLL items nested in lists/maps are not currently supported by the server.
Table of Contents
Methods
- add() : Operation
- HLLAddOp creates HLL add operation with minhash bits.
- describe() : Operation
- HLLDescribeOp creates HLL describe operation.
- fold() : Operation|null
- HLLFoldOp creates HLL fold operation.
- getCount() : Operation|null
- HLLGetCountOp creates HLL getCount operation.
- getIntersectCount() : Operation|null
- HLLGetIntersectCountOp creates HLL getIntersectCount operation.
- getSimilarity() : Operation|null
- HLLGetSimilarityOp creates HLL getSimilarity operation.
- getUnion() : Operation|null
- HLLGetUnionOp creates HLL getUnion operation.
- getUnionCount() : Operation|null
- HLLGetUnionCountOp creates HLL getUnionCount operation.
- init() : Operation
- HLLInitOp creates HLL init operation with minhash bits.
- refreshCount() : Operation|null
- HLLRefreshCountOp creates HLL refresh operation.
- setUnion() : Operation|null
- HLLSetUnionOp creates HLL set union operation.
Methods
add()
HLLAddOp creates HLL add operation with minhash bits.
public
static add(HllPolicy $policy, string $bin_name, array<string|int, mixed> $list, int $index_bit_count, int $min_hash_bit_count) : Operation
Server adds values to HLL set. If HLL bin does not exist, use indexBitCount and minHashBitCount to create HLL bin. Server returns number of entries that caused HLL to update a register.
policy write policy, use DefaultHLLPolicy for default binName name of bin list list of values to be added indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. indexBitCount + minHashBitCount must be <= 64.
Parameters
- $policy : HllPolicy
- $bin_name : string
- $list : array<string|int, mixed>
- $index_bit_count : int
- $min_hash_bit_count : int
Return values
Operationdescribe()
HLLDescribeOp creates HLL describe operation.
public
static describe(string $bin_name) : Operation
Server returns indexBitCount and minHashBitCount used to create HLL bin in a list of longs. The list size is 2.
binName name of bin
Parameters
- $bin_name : string
Return values
Operationfold()
HLLFoldOp creates HLL fold operation.
public
static fold(string $bin_name, int $index_bit_count) : Operation|null
Servers folds indexBitCount to the specified value. This can only be applied when minHashBitCount on the HLL bin is 0. Server does not return a value.
binName name of bin indexBitCount number of index bits. Must be between 4 and 16 inclusive.
Parameters
- $bin_name : string
- $index_bit_count : int
Return values
Operation|nullgetCount()
HLLGetCountOp creates HLL getCount operation.
public
static getCount(string $bin_name) : Operation|null
Server returns estimated number of elements in the HLL bin.
binName name of bin
Parameters
- $bin_name : string
Return values
Operation|nullgetIntersectCount()
HLLGetIntersectCountOp creates HLL getIntersectCount operation.
public
static getIntersectCount(string $bin_name, array<string|int, mixed> $list) : Operation|null
Server returns estimated number of elements that would be contained by the intersection of these HLL objects.
binName name of bin list list of HLL objects
Parameters
- $bin_name : string
- $list : array<string|int, mixed>
Return values
Operation|nullgetSimilarity()
HLLGetSimilarityOp creates HLL getSimilarity operation.
public
static getSimilarity(string $bin_name, array<string|int, mixed> $list) : Operation|null
Server returns estimated similarity of these HLL objects. Return type is a double.
binName name of bin list list of HLL objects
Parameters
- $bin_name : string
- $list : array<string|int, mixed>
Return values
Operation|nullgetUnion()
HLLGetUnionOp creates HLL getUnion operation.
public
static getUnion(string $bin_name, array<string|int, mixed> $list) : Operation|null
Server returns an HLL object that is the union of all specified HLL objects in the list with the HLL bin.
binName name of bin list list of HLL objects
Parameters
- $bin_name : string
- $list : array<string|int, mixed>
Return values
Operation|nullgetUnionCount()
HLLGetUnionCountOp creates HLL getUnionCount operation.
public
static getUnionCount(string $bin_name, array<string|int, mixed> $list) : Operation|null
Server returns estimated number of elements that would be contained by the union of these HLL objects.
binName name of bin list list of HLL objects
Parameters
- $bin_name : string
- $list : array<string|int, mixed>
Return values
Operation|nullinit()
HLLInitOp creates HLL init operation with minhash bits.
public
static init(HllPolicy $policy, string $bin_name, int $index_bit_count, int $min_hash_bit_count) : Operation
Server creates a new HLL or resets an existing HLL. Server does not return a value.
policy write policy, use DefaultHLLPolicy for default binName name of bin indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. indexBitCount + minHashBitCount must be <= 64.
Parameters
- $policy : HllPolicy
- $bin_name : string
- $index_bit_count : int
- $min_hash_bit_count : int
Return values
OperationrefreshCount()
HLLRefreshCountOp creates HLL refresh operation.
public
static refreshCount(string $bin_name) : Operation|null
Server updates the cached count (if stale) and returns the count.
binName name of bin
Parameters
- $bin_name : string
Return values
Operation|nullsetUnion()
HLLSetUnionOp creates HLL set union operation.
public
static setUnion(HllPolicy $policy, string $bin_name, array<string|int, mixed> $list) : Operation|null
Server sets union of specified HLL objects with HLL bin. Server does not return a value.
policy write policy, use DefaultHLLPolicy for default binName name of bin list list of HLL objects
Parameters
- $policy : HllPolicy
- $bin_name : string
- $list : array<string|int, mixed>