Ferricstore.Commands.Bloom (ferricstore v0.3.5)

Copy Markdown View Source

Handles Redis-compatible Bloom filter commands.

Write commands (BF.RESERVE, BF.ADD, BF.MADD) route through Raft via store.prob_write so that mutations are replicated to follower nodes. Read commands (BF.EXISTS, BF.MEXISTS, BF.CARD, BF.INFO) use stateless pread NIFs directly on the local file — no Raft, no mmap, no resource caching.

Supported Commands

  • BF.RESERVE key error_rate capacity -- creates a new Bloom filter
  • BF.ADD key element -- adds an element (auto-creates with defaults if missing)
  • BF.MADD key element [element ...] -- adds multiple elements
  • BF.EXISTS key element -- checks if an element may exist
  • BF.MEXISTS key element [element ...] -- checks multiple elements
  • BF.CARD key -- returns the number of elements added
  • BF.INFO key -- returns filter metadata

Summary

Functions

handle(cmd, args, store)

@spec handle(binary(), [binary()], map()) :: term()

nif_delete(key, store)

@spec nif_delete(binary(), map()) :: :ok