Handles Redis HyperLogLog commands: PFADD, PFCOUNT, PFMERGE.
Each handler takes the uppercased command name, a list of string arguments, and an injected store map. Returns plain Elixir terms -- the connection layer handles RESP encoding.
HyperLogLog sketches are stored as plain 16,384-byte binary values in the store with no expiry (expire_at_ms = 0). They are transparent to the store layer -- just another binary blob keyed by a string.
Supported commands
PFADD key element [element ...]-- adds elements to the HLL sketch atkey, creating it if absent. Returns 1 if the sketch was modified, 0 if not.PFCOUNT key [key ...]-- returns the estimated cardinality. For a single key, returns the estimate from that sketch. For multiple keys, merges sketches in memory (without writing) and returns the combined estimate. Non-existent keys are treated as empty sketches.PFMERGE destkey sourcekey [sourcekey ...]-- merges all source sketches intodestkey(which may or may not already exist). For each register position, takes the maximum value across all sources and the existing dest. Returns:ok.
Summary
Functions
Handles a HyperLogLog command.