Aerospike.Exp.HLL (Aerospike Driver v0.3.1)

Copy Markdown View Source

HyperLogLog expression helpers.

Summary

Types

HyperLogLog expression modify options.

t()

Opaque server-side expression.

Functions

Returns [index_bit_count, min_hash_bit_count] for the HLL value.

Returns the estimated cardinality.

Returns the estimated cardinality of the intersection of bin and hlls.

Returns an estimated similarity score for bin and hlls.

Returns an HLL expression containing the union of bin and hlls.

Returns the estimated cardinality of the union of bin and hlls.

Returns whether the HLL value may contain every element in elements.

Types

opts()

@type opts() :: [
  {:flags, atom() | [atom()] | non_neg_integer() | {:raw, non_neg_integer()}}
]

HyperLogLog expression modify options.

Supported key:

  • :flags - HLL write flags. Defaults to :default.

t()

@type t() :: Aerospike.Exp.t()

Opaque server-side expression.

Functions

add(bin, elements, index_bit_count \\ Exp.int(-1), min_hash_bit_count \\ Exp.int(-1), opts \\ [])

Adds element expressions to an HLL expression value.

elements must evaluate to a list. Supports flags:.

describe(bin)

@spec describe(Aerospike.Exp.t()) :: t()

Returns [index_bit_count, min_hash_bit_count] for the HLL value.

get_count(bin)

@spec get_count(Aerospike.Exp.t()) :: t()

Returns the estimated cardinality.

get_intersect_count(bin, hlls)

@spec get_intersect_count(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns the estimated cardinality of the intersection of bin and hlls.

get_similarity(bin, hlls)

@spec get_similarity(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns an estimated similarity score for bin and hlls.

get_union(bin, hlls)

@spec get_union(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns an HLL expression containing the union of bin and hlls.

get_union_count(bin, hlls)

@spec get_union_count(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns the estimated cardinality of the union of bin and hlls.

init(bin, index_bit_count, min_hash_bit_count \\ Exp.int(-1), opts \\ [])

@spec init(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Creates or resets an HLL expression value.

index_bit_count and min_hash_bit_count default to Exp.int(-1), asking the server to use its defaults. Supports flags:.

may_contain(bin, elements)

@spec may_contain(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Returns whether the HLL value may contain every element in elements.