![]() |
HyperLogLog (HLL) operations.
HyperLogLog operations on HLL items nested in lists/maps are not currently supported by the server. The as_cdt_ctx argument in HLL operations must be set to NULL.
Data Structures | |
struct | as_hll_policy |
Enumerations | |
enum | as_hll_write_flags { AS_HLL_WRITE_DEFAULT = 0 , AS_HLL_WRITE_CREATE_ONLY = 1 , AS_HLL_WRITE_UPDATE_ONLY = 2 , AS_HLL_WRITE_NO_FAIL = 4 , AS_HLL_WRITE_ALLOW_FOLD = 8 } |
enum as_hll_write_flags |
HyperLogLog write flags.
Definition at line 45 of file as_hll_operations.h.
|
inlinestatic |
Initialize HLL policy to default.
Definition at line 128 of file as_hll_operations.h.
References AS_HLL_WRITE_DEFAULT, and as_hll_policy::flags.
|
inlinestatic |
Set HLL write flags in HLL policy.
Definition at line 139 of file as_hll_operations.h.
References as_hll_policy::flags.
|
inlinestatic |
Create HLL add operation with index bits. Server adds values to HLL set. If HLL bin does not exist, use bit counts to create HLL bin. Server returns number of entries that caused HLL to update a register.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
list | List of values to be added. |
index_bit_count | Number of index bits. Must be between 4 and 16 inclusive. |
Definition at line 220 of file as_hll_operations.h.
References as_operations_hll_add_mh().
AS_EXTERN bool as_operations_hll_add_mh | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_hll_policy * | policy, | ||
as_list * | list, | ||
int | index_bit_count, | ||
int | mh_bit_count ) |
Create HLL add operation with minhash bits. Server adds values to HLL set. If HLL bin does not exist, use bit counts to create HLL bin. Server returns number of entries that caused HLL to update a register.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
list | List of values to be added. |
index_bit_count | Number of index bits. Must be between 4 and 16 inclusive. |
mh_bit_count | Number of min hash bits. Must be between 4 and 51 inclusive. Also, index_bit_count + mh_bit_count must be <= 64. |
|
inlinestatic |
Create HLL describe operation. Server returns index and minhash bit counts used to create HLL bin in a list of integers. The list size is 2.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
Definition at line 401 of file as_hll_operations.h.
References AS_HLL_OP_DESCRIBE, and as_operations_hll_read().
AS_EXTERN bool as_operations_hll_fold | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int | index_bit_count ) |
Create HLL fold operation. Servers folds index_bit_count to the specified value. This can only be applied when minhash bit count on the HLL bin is 0. Server does not return a value.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
index_bit_count | Number of index bits. Must be between 4 and 16 inclusive. |
|
inlinestatic |
Create HLL get count operation. Server returns estimated number of elements in the HLL bin.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
Definition at line 308 of file as_hll_operations.h.
References AS_HLL_OP_COUNT, and as_operations_hll_read().
|
inlinestatic |
Create HLL get intersect count operation. Server returns estimated number of elements that would be contained by the intersection of these HLL objects.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
list | List of HLL as_bytes objects. |
Definition at line 365 of file as_hll_operations.h.
References AS_HLL_OP_INTERSECT_COUNT, and as_operations_hll_read_list().
|
inlinestatic |
Create HLL get similarity operation. Server returns estimated similarity of these HLL objects. Return type is a double.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
list | List of HLL as_bytes objects. |
Definition at line 383 of file as_hll_operations.h.
References AS_HLL_OP_SIMILARITY, and as_operations_hll_read_list().
|
inlinestatic |
Create HLL get union operation. Server returns an HLL object that is the union of all specified HLL objects in the list with the HLL bin.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
list | List of HLL as_bytes objects. |
Definition at line 327 of file as_hll_operations.h.
References AS_HLL_OP_GET_UNION, and as_operations_hll_read_list().
|
inlinestatic |
Create HLL get union count operation. Server returns estimated number of elements that would be contained by the union of these HLL objects.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
list | List of HLL as_bytes objects. |
Definition at line 346 of file as_hll_operations.h.
References AS_HLL_OP_UNION_COUNT, and as_operations_hll_read_list().
|
inlinestatic |
Create HLL init operation. Server creates a new HLL or resets an existing HLL. Server does not return a value.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
index_bit_count | Number of index bits. Must be between 4 and 16 inclusive. |
Definition at line 177 of file as_hll_operations.h.
References as_operations_hll_init_mh().
AS_EXTERN bool as_operations_hll_init_mh | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_hll_policy * | policy, | ||
int | index_bit_count, | ||
int | mh_bit_count ) |
Create HLL init operation with minhash bits. Server creates a new HLL or resets an existing HLL. Server does not return a value.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
index_bit_count | Number of index bits. Must be between 4 and 16 inclusive. |
mh_bit_count | Number of min hash bits. Must be between 4 and 51 inclusive. Also, index_bit_count + mh_bit_count must be <= 64. |
AS_EXTERN bool as_operations_hll_refresh_count | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx ) |
Create HLL refresh operation. Server updates the cached count (if stale) and returns the count.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
AS_EXTERN bool as_operations_hll_set_union | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_hll_policy * | policy, | ||
as_list * | list ) |
Create HLL set union operation. Server sets union of specified HLL objects with HLL bin. Server does not return a value.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
list | List of HLL as_bytes objects. |
|
inlinestatic |
Create HLL update operation. This operation assumes HLL bin already exists. Server adds values to HLL set. Server returns number of entries that caused HLL to update a register.
ops | Operations array. |
name | Name of bin. |
ctx | Must set to NULL. |
policy | Write policy. Use NULL for default. |
list | List of values to be added. |
Definition at line 241 of file as_hll_operations.h.
References as_operations_hll_add_mh().