HyperLogLog operations for Aerospike.operate/4.
HyperLogLog bins require Aerospike server 4.9 or later. The server does not
support HyperLogLog bins nested inside lists or maps, so these operations do
not accept ctx:.
init/4 and add/5 default both bit counts to -1, which asks the server
to choose its defaults. When set explicitly, index bits are typically 4 to
16, min-hash bits 4 to 58, and their sum must not exceed 64.
Multi-HLL read operations accept hlls as a list of {:bytes, blob} HLL
values. Modify operations accept mnemonic flags: values for the server
write policy.
Summary
Types
HyperLogLog write flags.
Options accepted by multi-HLL read helpers.
Opaque HyperLogLog operation for Aerospike.operate/4.
Options accepted by HyperLogLog modify operations.
Functions
Adds elements to a HyperLogLog bin.
Returns [index_bit_count, min_hash_bit_count] for the HyperLogLog bin.
Folds the HyperLogLog bin to a smaller index bit count.
Returns the estimated cardinality of the HyperLogLog bin.
Returns the estimated cardinality of the intersection of the bin and hlls.
Returns an estimated similarity score for the bin and hlls.
Returns a HyperLogLog blob containing the union of the bin and hlls.
Returns the estimated cardinality of the union of the bin and hlls.
Creates a new HyperLogLog bin or resets an existing one.
Refreshes stale cached cardinality and returns the estimated count.
Merges every HyperLogLog value in hlls into the bin.
Allow folding to less precise HyperLogLog settings when needed.
Only create the HyperLogLog bin when it does not already exist.
Use default HyperLogLog write behavior.
Do not fail the command when a HyperLogLog operation is denied by write flags.
Only update the HyperLogLog bin when it already exists.
Types
@type flags() :: atom() | [atom()] | non_neg_integer() | {:raw, non_neg_integer()}
HyperLogLog write flags.
Accepts :default, :create_only, :update_only, :no_fail,
:allow_fold, or a list of those atoms. Compatibility callers may pass a
non-negative integer; use {:raw, integer} when deliberately sending an
unnamed server value.
@type read_opts() :: []
Options accepted by multi-HLL read helpers.
No option keys are currently encoded for these read operations; the argument is accepted for API consistency.
@opaque t()
Opaque HyperLogLog operation for Aerospike.operate/4.
@type write_opts() :: [{:flags, flags()}]
Options accepted by HyperLogLog modify operations.
Supported key:
:flags- HyperLogLog write flags. Defaults to:default.
Functions
Adds elements to a HyperLogLog bin.
Elements may be strings or {:bytes, binary} values. If the bin is missing,
the server creates it using the supplied bit counts.
Returns [index_bit_count, min_hash_bit_count] for the HyperLogLog bin.
Folds the HyperLogLog bin to a smaller index bit count.
Returns the estimated cardinality of the HyperLogLog bin.
Returns the estimated cardinality of the intersection of the bin and hlls.
Returns an estimated similarity score for the bin and hlls.
Returns a HyperLogLog blob containing the union of the bin and hlls.
Returns the estimated cardinality of the union of the bin and hlls.
@spec init(String.t(), integer(), integer(), write_opts()) :: t()
Creates a new HyperLogLog bin or resets an existing one.
Refreshes stale cached cardinality and returns the estimated count.
@spec set_union(String.t(), list(), write_opts()) :: t()
Merges every HyperLogLog value in hlls into the bin.
@spec write_allow_fold() :: 8
Allow folding to less precise HyperLogLog settings when needed.
@spec write_create_only() :: 1
Only create the HyperLogLog bin when it does not already exist.
@spec write_default() :: 0
Use default HyperLogLog write behavior.
@spec write_no_fail() :: 4
Do not fail the command when a HyperLogLog operation is denied by write flags.
@spec write_update_only() :: 2
Only update the HyperLogLog bin when it already exists.