FerricStore (ferricstore v0.4.3)

Copy Markdown View Source

Module-based cache instances for FerricStore.

Each module that calls use FerricStore gets a local direct cache instance with its own shards, ETS tables, data directory, and config. The default application instance owns the Raft system.

Usage

defmodule MyApp.Cache do
  use FerricStore,
    data_dir: "/data/cache",
    shard_count: 4,
    max_memory: "1GB"
end

# In your supervision tree:
children = [MyApp.Cache]

# Then use it:
MyApp.Cache.set("key", "value")
{:ok, "value"} = MyApp.Cache.get("key")

Multiple instances

defmodule MyApp.Sessions do
  use FerricStore,
    data_dir: "/data/sessions",
    shard_count: 2
end

MyApp.Cache.set("page:home", html)
MyApp.Sessions.set("sess:abc", session_data)

Options

  • :data_dir — base directory for Bitcask data files (required)
  • :shard_count — number of shards (default: 4)
  • :max_memory_bytes — maximum memory budget (default: 1GB)
  • :keydir_max_ram — maximum ETS keydir memory (default: 256MB)
  • :eviction_policy:volatile_lfu | :allkeys_lfu | :noeviction (default: :volatile_lfu)

  • :hot_cache_max_value_size — max value size for ETS caching (default: 65536)
  • :read_sample_rate — LFU sampling rate (default: 100)

Summary

Functions

See FerricStore.API.Strings.append/2.

Blocks until FerricStore is fully ready to serve requests.

See FerricStore.API.System.batch_get/1.

See FerricStore.API.System.batch_set/1.

See FerricStore.API.Probabilistic.bf_add/2.

See FerricStore.API.Probabilistic.bf_card/1.

See FerricStore.API.Probabilistic.bf_exists/2.

See FerricStore.API.Probabilistic.bf_info/1.

See FerricStore.API.Probabilistic.bf_madd/2.

See FerricStore.API.Probabilistic.bf_mexists/2.

See FerricStore.API.Probabilistic.bf_reserve/3.

See FerricStore.API.Bitmap.bitcount/2.

See FerricStore.API.Bitmap.bitop/3.

See FerricStore.API.Bitmap.bitpos/3.

See FerricStore.API.Generic.cas/4.

See FerricStore.API.Probabilistic.cf_add/2.

See FerricStore.API.Probabilistic.cf_addnx/2.

See FerricStore.API.Probabilistic.cf_count/2.

See FerricStore.API.Probabilistic.cf_del/2.

See FerricStore.API.Probabilistic.cf_exists/2.

See FerricStore.API.Probabilistic.cf_info/1.

See FerricStore.API.Probabilistic.cf_mexists/2.

See FerricStore.API.Probabilistic.cf_reserve/2.

See FerricStore.API.Probabilistic.cms_incrby/2.

See FerricStore.API.Probabilistic.cms_info/1.

See FerricStore.API.Probabilistic.cms_initbydim/3.

See FerricStore.API.Probabilistic.cms_initbyprob/3.

See FerricStore.API.Probabilistic.cms_query/2.

See FerricStore.API.Generic.copy/3.

See FerricStore.API.Generic.dbsize/0.

See FerricStore.API.Strings.decr/1.

See FerricStore.API.Strings.decr_by/2.

See FerricStore.API.Strings.del/1.

See FerricStore.API.System.echo/1.

See FerricStore.API.Generic.exists/1.

See FerricStore.API.Generic.expire/2.

See FerricStore.API.Generic.expireat/2.

See FerricStore.API.Generic.expiretime/1.

See FerricStore.API.Locks.extend/3.

See FerricStore.API.Generic.fetch_or_compute/2.

See FerricStore.API.Generic.fetch_or_compute_result/3.

See FerricStore.API.Flow.flow_by_correlation/2.

See FerricStore.API.Flow.flow_by_parent/2.

See FerricStore.API.Flow.flow_by_root/2.

See FerricStore.API.Flow.flow_cancel/2.

See FerricStore.API.Flow.flow_cancel_many/3.

See FerricStore.API.Flow.flow_claim_due/2.

See FerricStore.API.Flow.flow_complete/3.

See FerricStore.API.Flow.flow_complete_many/3.

See FerricStore.API.Flow.flow_create/2.

See FerricStore.API.Flow.flow_create_many/3.

See FerricStore.API.Flow.flow_extend_lease/3.

See FerricStore.API.Flow.flow_fail/3.

See FerricStore.API.Flow.flow_fail_many/3.

See FerricStore.API.Flow.flow_failures/2.

See FerricStore.API.Flow.flow_get/2.

See FerricStore.API.Flow.flow_history/2.

See FerricStore.API.Flow.flow_info/2.

See FerricStore.API.Flow.flow_list/2.

See FerricStore.API.Flow.flow_policy_get/2.

See FerricStore.API.Flow.flow_policy_set/2.

See FerricStore.API.Flow.flow_reclaim/2.

See FerricStore.API.Flow.flow_retention_cleanup/1.

See FerricStore.API.Flow.flow_retry/3.

See FerricStore.API.Flow.flow_retry_many/3.

See FerricStore.API.Flow.flow_rewind/2.

See FerricStore.API.Flow.flow_signal/2.

See FerricStore.API.Flow.flow_spawn_children/3.

See FerricStore.API.Flow.flow_stuck/2.

See FerricStore.API.Flow.flow_terminals/2.

See FerricStore.API.Flow.flow_transition/4.

See FerricStore.API.Flow.flow_transition_many/5.

See FerricStore.API.Flow.flow_value_mget/1.

See FerricStore.API.Flow.flow_value_put/2.

See FerricStore.API.System.flushall/0.

See FerricStore.API.Generic.flushdb/0.

See FerricStore.API.Geo.geoadd/2.

See FerricStore.API.Geo.geodist/4.

See FerricStore.API.Geo.geohash/2.

See FerricStore.API.Geo.geopos/2.

See FerricStore.API.Strings.get/2.

See FerricStore.API.Bitmap.getbit/2.

See FerricStore.API.Strings.getdel/1.

See FerricStore.API.Strings.getex/2.

See FerricStore.API.Strings.getrange/3.

See FerricStore.API.Strings.getset/2.

See FerricStore.API.Hashes.hdel/2.

Returns the current health status without blocking.

See FerricStore.API.Hashes.hexists/2.

See FerricStore.API.Hashes.hget/2.

See FerricStore.API.Hashes.hgetall/1.

See FerricStore.API.Hashes.hincrby/3.

See FerricStore.API.Hashes.hincrbyfloat/3.

See FerricStore.API.Hashes.hkeys/1.

See FerricStore.API.Hashes.hlen/1.

See FerricStore.API.Hashes.hmget/2.

See FerricStore.API.Hashes.hrandfield/2.

See FerricStore.API.Hashes.hset/2.

See FerricStore.API.Hashes.hsetnx/3.

See FerricStore.API.Hashes.hstrlen/2.

See FerricStore.API.Hashes.hvals/1.

See FerricStore.API.Strings.incr/1.

See FerricStore.API.Strings.incr_by/2.

See FerricStore.API.Strings.incr_by_float/2.

See FerricStore.API.Json.json_arrappend/3.

See FerricStore.API.Json.json_arrlen/2.

See FerricStore.API.Json.json_del/2.

See FerricStore.API.Json.json_get/2.

See FerricStore.API.Json.json_numincrby/3.

See FerricStore.API.Json.json_objkeys/2.

See FerricStore.API.Json.json_objlen/2.

See FerricStore.API.Json.json_set/3.

See FerricStore.API.Json.json_strlen/2.

See FerricStore.API.Json.json_type/2.

See FerricStore.API.Generic.keys/1.

See FerricStore.API.Lists.lindex/2.

See FerricStore.API.Lists.linsert/4.

See FerricStore.API.Lists.llen/1.

See FerricStore.API.Lists.lmove/4.

See FerricStore.API.Locks.lock/3.

See FerricStore.API.Lists.lpop/2.

See FerricStore.API.Lists.lpos/3.

See FerricStore.API.Lists.lpush/2.

See FerricStore.API.Lists.lrange/3.

See FerricStore.API.Lists.lrem/3.

See FerricStore.API.Lists.lset/3.

See FerricStore.API.Strings.mget/1.

See FerricStore.API.Strings.mset/1.

See FerricStore.API.Strings.msetnx/1.

See FerricStore.API.System.multi/1.

See FerricStore.API.System.packed_batch_get/1.

See FerricStore.API.Generic.persist/1.

See FerricStore.API.Generic.pexpire/2.

See FerricStore.API.Generic.pexpireat/2.

See FerricStore.API.Generic.pexpiretime/1.

See FerricStore.API.HyperLogLog.pfadd/2.

See FerricStore.API.HyperLogLog.pfcount/1.

See FerricStore.API.HyperLogLog.pfmerge/2.

See FerricStore.API.System.ping/0.

See FerricStore.API.System.pipeline/1.

See FerricStore.API.Strings.psetex/3.

See FerricStore.API.Generic.pttl/1.

See FerricStore.API.Generic.randomkey/0.

See FerricStore.API.Locks.ratelimit_add/4.

Returns true if FerricStore is ready to serve requests.

See FerricStore.API.Generic.rename/2.

See FerricStore.API.Generic.renamenx/2.

See FerricStore.API.Lists.rpop/2.

See FerricStore.API.Lists.rpush/2.

See FerricStore.API.Sets.sadd/2.

See FerricStore.API.Sets.scard/1.

See FerricStore.API.Sets.sdiff/1.

See FerricStore.API.Sets.sdiffstore/2.

See FerricStore.API.Strings.set/3.

See FerricStore.API.Bitmap.setbit/3.

See FerricStore.API.Strings.setex/3.

See FerricStore.API.Strings.setnx/2.

See FerricStore.API.Strings.setrange/3.

Gracefully shuts down FerricStore, flushing all pending data to disk.

See FerricStore.API.Sets.sinter/1.

See FerricStore.API.Sets.sintercard/2.

See FerricStore.API.Sets.sinterstore/2.

See FerricStore.API.Sets.sismember/2.

See FerricStore.API.Sets.smembers/1.

See FerricStore.API.Sets.smismember/2.

See FerricStore.API.Sets.spop/2.

See FerricStore.API.Sets.srandmember/2.

See FerricStore.API.Sets.srem/2.

See FerricStore.API.Strings.strlen/1.

See FerricStore.API.Sets.sunion/1.

See FerricStore.API.Sets.sunionstore/2.

See FerricStore.API.Probabilistic.tdigest_add/2.

See FerricStore.API.Probabilistic.tdigest_byrank/2.

See FerricStore.API.Probabilistic.tdigest_byrevrank/2.

See FerricStore.API.Probabilistic.tdigest_cdf/2.

See FerricStore.API.Probabilistic.tdigest_create/1.

See FerricStore.API.Probabilistic.tdigest_info/1.

See FerricStore.API.Probabilistic.tdigest_max/1.

See FerricStore.API.Probabilistic.tdigest_min/1.

See FerricStore.API.Probabilistic.tdigest_quantile/2.

See FerricStore.API.Probabilistic.tdigest_rank/2.

See FerricStore.API.Probabilistic.tdigest_reset/1.

See FerricStore.API.Probabilistic.tdigest_revrank/2.

See FerricStore.API.Probabilistic.tdigest_trimmed_mean/3.

See FerricStore.API.Probabilistic.topk_add/2.

See FerricStore.API.Probabilistic.topk_info/1.

See FerricStore.API.Probabilistic.topk_list/1.

See FerricStore.API.Probabilistic.topk_query/2.

See FerricStore.API.Probabilistic.topk_reserve/2.

See FerricStore.API.Generic.ttl/1.

See FerricStore.API.Generic.type/1.

See FerricStore.API.Locks.unlock/2.

See FerricStore.API.Streams.xadd/2.

See FerricStore.API.Streams.xlen/1.

See FerricStore.API.Streams.xrange/4.

See FerricStore.API.Streams.xrevrange/4.

See FerricStore.API.Streams.xtrim/2.

See FerricStore.API.SortedSets.zadd/2.

See FerricStore.API.SortedSets.zcard/1.

See FerricStore.API.SortedSets.zcount/3.

See FerricStore.API.SortedSets.zincrby/3.

See FerricStore.API.SortedSets.zmscore/2.

See FerricStore.API.SortedSets.zpopmax/2.

See FerricStore.API.SortedSets.zpopmin/2.

See FerricStore.API.SortedSets.zrandmember/2.

See FerricStore.API.SortedSets.zrange/4.

See FerricStore.API.SortedSets.zrangebyscore/4.

See FerricStore.API.SortedSets.zrank/2.

See FerricStore.API.SortedSets.zrem/2.

See FerricStore.API.SortedSets.zrevrank/2.

See FerricStore.API.SortedSets.zscore/2.

Types

cas_opts()

@type cas_opts() :: [{:ttl, non_neg_integer()}]

fetch_or_compute_opts()

@type fetch_or_compute_opts() :: [ttl: pos_integer(), hint: binary()]

get_opts()

@type get_opts() :: [{:cache, atom()}]

key()

@type key() :: binary()

set_opts()

@type set_opts() :: [
  ttl: non_neg_integer(),
  exat: pos_integer(),
  pxat: pos_integer(),
  nx: boolean(),
  xx: boolean(),
  get: boolean(),
  keepttl: boolean(),
  cache: atom()
]

value()

@type value() :: binary()

write_error()

@type write_error() :: {:error, binary() | {:timeout, :unknown_outcome}}

zrange_opts()

@type zrange_opts() :: [{:withscores, boolean()}]

Functions

append(key, suffix)

See FerricStore.API.Strings.append/2.

await_ready(opts \\ [])

@spec await_ready(keyword()) :: :ok

Blocks until FerricStore is fully ready to serve requests.

Polls Health.check/0 until all shards are alive and all Raft leaders are elected. Returns :ok when ready, raises on timeout.

Call this in your application's start/2 after FerricStore is in your supervision tree, or in test setup, to ensure writes won't fail.

Options

  • :timeout - max milliseconds to wait (default: 30_000)
  • :interval - polling interval in ms (default: 100)

Examples

# In your Application.start/2:
def start(_type, _args) do
  children = [
    {FerricStore, []},
    MyApp.Repo,
    MyAppWeb.Endpoint
  ]
  opts = [strategy: :one_for_one, name: MyApp.Supervisor]
  {:ok, pid} = Supervisor.start_link(children, opts)

  FerricStore.await_ready()
  {:ok, pid}
end

# With custom timeout:
FerricStore.await_ready(timeout: 60_000)

batch_get(keys)

See FerricStore.API.System.batch_get/1.

batch_set(kv_pairs)

@spec batch_set([{binary(), binary()}]) :: [:ok | write_error()]

See FerricStore.API.System.batch_set/1.

bf_add(key, element)

See FerricStore.API.Probabilistic.bf_add/2.

bf_card(key)

See FerricStore.API.Probabilistic.bf_card/1.

bf_exists(key, element)

See FerricStore.API.Probabilistic.bf_exists/2.

bf_info(key)

See FerricStore.API.Probabilistic.bf_info/1.

bf_madd(key, elements)

See FerricStore.API.Probabilistic.bf_madd/2.

bf_mexists(key, elements)

See FerricStore.API.Probabilistic.bf_mexists/2.

bf_reserve(key, error_rate, capacity)

See FerricStore.API.Probabilistic.bf_reserve/3.

bitcount(key, opts \\ [])

See FerricStore.API.Bitmap.bitcount/2.

bitop(op, dest_key, source_keys)

See FerricStore.API.Bitmap.bitop/3.

bitpos(key, bit_value, opts \\ [])

See FerricStore.API.Bitmap.bitpos/3.

cas(key, expected, new_value, opts \\ [])

See FerricStore.API.Generic.cas/4.

cf_add(key, element)

See FerricStore.API.Probabilistic.cf_add/2.

cf_addnx(key, element)

See FerricStore.API.Probabilistic.cf_addnx/2.

cf_count(key, element)

See FerricStore.API.Probabilistic.cf_count/2.

cf_del(key, element)

See FerricStore.API.Probabilistic.cf_del/2.

cf_exists(key, element)

See FerricStore.API.Probabilistic.cf_exists/2.

cf_info(key)

See FerricStore.API.Probabilistic.cf_info/1.

cf_mexists(key, elements)

See FerricStore.API.Probabilistic.cf_mexists/2.

cf_reserve(key, capacity)

See FerricStore.API.Probabilistic.cf_reserve/2.

cms_incrby(key, pairs)

See FerricStore.API.Probabilistic.cms_incrby/2.

cms_info(key)

See FerricStore.API.Probabilistic.cms_info/1.

cms_initbydim(key, width, depth)

See FerricStore.API.Probabilistic.cms_initbydim/3.

cms_initbyprob(key, error, probability)

See FerricStore.API.Probabilistic.cms_initbyprob/3.

cms_query(key, elements)

See FerricStore.API.Probabilistic.cms_query/2.

copy(source, destination, opts \\ [])

See FerricStore.API.Generic.copy/3.

dbsize()

See FerricStore.API.Generic.dbsize/0.

decr(key)

See FerricStore.API.Strings.decr/1.

decr_by(key, amount)

See FerricStore.API.Strings.decr_by/2.

del(key)

See FerricStore.API.Strings.del/1.

echo(message)

See FerricStore.API.System.echo/1.

exists(key)

See FerricStore.API.Generic.exists/1.

expire(key, ttl_ms)

See FerricStore.API.Generic.expire/2.

expireat(key, unix_ts_seconds)

See FerricStore.API.Generic.expireat/2.

expiretime(key)

See FerricStore.API.Generic.expiretime/1.

extend(key, owner, ttl_ms)

See FerricStore.API.Locks.extend/3.

fetch_or_compute(key, opts)

See FerricStore.API.Generic.fetch_or_compute/2.

fetch_or_compute_result(key, value, opts)

See FerricStore.API.Generic.fetch_or_compute_result/3.

flow_by_correlation(correlation_id, opts \\ [])

See FerricStore.API.Flow.flow_by_correlation/2.

flow_by_parent(parent_flow_id, opts \\ [])

See FerricStore.API.Flow.flow_by_parent/2.

flow_by_root(root_flow_id, opts \\ [])

See FerricStore.API.Flow.flow_by_root/2.

flow_cancel(id, opts \\ [])

See FerricStore.API.Flow.flow_cancel/2.

flow_cancel_many(partition_key, items, opts \\ [])

See FerricStore.API.Flow.flow_cancel_many/3.

flow_claim_due(type, opts)

See FerricStore.API.Flow.flow_claim_due/2.

flow_complete(id, lease_token, opts \\ [])

See FerricStore.API.Flow.flow_complete/3.

flow_complete_many(partition_key, items, opts \\ [])

See FerricStore.API.Flow.flow_complete_many/3.

flow_create(id, opts)

See FerricStore.API.Flow.flow_create/2.

flow_create_many(partition_key, items, opts \\ [])

See FerricStore.API.Flow.flow_create_many/3.

flow_extend_lease(id, lease_token, opts \\ [])

See FerricStore.API.Flow.flow_extend_lease/3.

flow_fail(id, lease_token, opts \\ [])

See FerricStore.API.Flow.flow_fail/3.

flow_fail_many(partition_key, items, opts \\ [])

See FerricStore.API.Flow.flow_fail_many/3.

flow_failures(type, opts \\ [])

See FerricStore.API.Flow.flow_failures/2.

flow_get(id, opts \\ [])

See FerricStore.API.Flow.flow_get/2.

flow_history(id, opts \\ [])

See FerricStore.API.Flow.flow_history/2.

flow_info(type, opts \\ [])

See FerricStore.API.Flow.flow_info/2.

flow_list(type, opts \\ [])

See FerricStore.API.Flow.flow_list/2.

flow_policy_get(type, opts \\ [])

See FerricStore.API.Flow.flow_policy_get/2.

flow_policy_set(type, opts)

See FerricStore.API.Flow.flow_policy_set/2.

flow_reclaim(type, opts)

See FerricStore.API.Flow.flow_reclaim/2.

flow_retention_cleanup(opts \\ [])

See FerricStore.API.Flow.flow_retention_cleanup/1.

flow_retry(id, lease_token, opts)

See FerricStore.API.Flow.flow_retry/3.

flow_retry_many(partition_key, items, opts \\ [])

See FerricStore.API.Flow.flow_retry_many/3.

flow_rewind(id, opts)

See FerricStore.API.Flow.flow_rewind/2.

flow_signal(id, opts)

See FerricStore.API.Flow.flow_signal/2.

flow_spawn_children(parent_id, children, opts \\ [])

See FerricStore.API.Flow.flow_spawn_children/3.

flow_stuck(type, opts \\ [])

See FerricStore.API.Flow.flow_stuck/2.

flow_terminals(type, opts \\ [])

See FerricStore.API.Flow.flow_terminals/2.

flow_transition(id, from_state, to_state, opts \\ [])

See FerricStore.API.Flow.flow_transition/4.

flow_transition_many(partition_key, from_state, to_state, items, opts \\ [])

See FerricStore.API.Flow.flow_transition_many/5.

flow_value_mget(refs)

See FerricStore.API.Flow.flow_value_mget/1.

flow_value_put(value, opts \\ [])

See FerricStore.API.Flow.flow_value_put/2.

flushall()

@spec flushall() :: :ok | {:error, term()}

See FerricStore.API.System.flushall/0.

flushdb()

See FerricStore.API.Generic.flushdb/0.

geoadd(key, members)

See FerricStore.API.Geo.geoadd/2.

geodist(key, member1, member2, unit \\ "m")

See FerricStore.API.Geo.geodist/4.

geohash(key, members)

See FerricStore.API.Geo.geohash/2.

geopos(key, members)

See FerricStore.API.Geo.geopos/2.

get(key, opts \\ [])

See FerricStore.API.Strings.get/2.

getbit(key, offset)

See FerricStore.API.Bitmap.getbit/2.

getdel(key)

See FerricStore.API.Strings.getdel/1.

getex(key, opts \\ [])

See FerricStore.API.Strings.getex/2.

getrange(key, start, stop)

See FerricStore.API.Strings.getrange/3.

getset(key, value)

See FerricStore.API.Strings.getset/2.

hdel(key, fields)

See FerricStore.API.Hashes.hdel/2.

health()

@spec health() :: Ferricstore.Health.health_result()

Returns the current health status without blocking.

Examples

iex> FerricStore.health()
%{status: :ok, shard_count: 4, shards: [...], uptime_seconds: 120}

hexists(key, field)

See FerricStore.API.Hashes.hexists/2.

hget(key, field)

See FerricStore.API.Hashes.hget/2.

hgetall(key)

See FerricStore.API.Hashes.hgetall/1.

hincrby(key, field, amount)

See FerricStore.API.Hashes.hincrby/3.

hincrbyfloat(key, field, amount)

See FerricStore.API.Hashes.hincrbyfloat/3.

hkeys(key)

See FerricStore.API.Hashes.hkeys/1.

hlen(key)

See FerricStore.API.Hashes.hlen/1.

hmget(key, fields)

See FerricStore.API.Hashes.hmget/2.

hrandfield(key, count \\ nil)

See FerricStore.API.Hashes.hrandfield/2.

hset(key, fields)

See FerricStore.API.Hashes.hset/2.

hsetnx(key, field, value)

See FerricStore.API.Hashes.hsetnx/3.

hstrlen(key, field)

See FerricStore.API.Hashes.hstrlen/2.

hvals(key)

See FerricStore.API.Hashes.hvals/1.

incr(key)

See FerricStore.API.Strings.incr/1.

incr_by(key, amount)

See FerricStore.API.Strings.incr_by/2.

incr_by_float(key, amount)

See FerricStore.API.Strings.incr_by_float/2.

json_arrappend(key, path, values)

See FerricStore.API.Json.json_arrappend/3.

json_arrlen(key, path \\ "$")

See FerricStore.API.Json.json_arrlen/2.

json_del(key, path \\ "$")

See FerricStore.API.Json.json_del/2.

json_get(key, path \\ "$")

See FerricStore.API.Json.json_get/2.

json_numincrby(key, path, increment)

See FerricStore.API.Json.json_numincrby/3.

json_objkeys(key, path \\ "$")

See FerricStore.API.Json.json_objkeys/2.

json_objlen(key, path \\ "$")

See FerricStore.API.Json.json_objlen/2.

json_set(key, path, value)

See FerricStore.API.Json.json_set/3.

json_strlen(key, path \\ "$")

See FerricStore.API.Json.json_strlen/2.

json_type(key, path \\ "$")

See FerricStore.API.Json.json_type/2.

keys(pattern \\ "*")

See FerricStore.API.Generic.keys/1.

lindex(key, index)

See FerricStore.API.Lists.lindex/2.

linsert(key, direction, pivot, element)

See FerricStore.API.Lists.linsert/4.

llen(key)

See FerricStore.API.Lists.llen/1.

lmove(source, destination, from_dir, to_dir)

See FerricStore.API.Lists.lmove/4.

lock(key, owner, ttl_ms)

See FerricStore.API.Locks.lock/3.

lpop(key, count \\ 1)

See FerricStore.API.Lists.lpop/2.

lpos(key, element, opts \\ [])

See FerricStore.API.Lists.lpos/3.

lpush(key, elements)

See FerricStore.API.Lists.lpush/2.

lrange(key, start, stop)

See FerricStore.API.Lists.lrange/3.

lrem(key, count, element)

See FerricStore.API.Lists.lrem/3.

lset(key, index, element)

See FerricStore.API.Lists.lset/3.

mget(keys)

See FerricStore.API.Strings.mget/1.

mset(pairs)

See FerricStore.API.Strings.mset/1.

msetnx(pairs)

See FerricStore.API.Strings.msetnx/1.

multi(fun)

See FerricStore.API.System.multi/1.

packed_batch_get(packed_keys)

See FerricStore.API.System.packed_batch_get/1.

persist(key)

See FerricStore.API.Generic.persist/1.

pexpire(key, ttl_ms)

See FerricStore.API.Generic.pexpire/2.

pexpireat(key, unix_ts_ms)

See FerricStore.API.Generic.pexpireat/2.

pexpiretime(key)

See FerricStore.API.Generic.pexpiretime/1.

pfadd(key, elements)

See FerricStore.API.HyperLogLog.pfadd/2.

pfcount(keys)

See FerricStore.API.HyperLogLog.pfcount/1.

pfmerge(dest_key, source_keys)

See FerricStore.API.HyperLogLog.pfmerge/2.

ping()

See FerricStore.API.System.ping/0.

pipeline(fun)

See FerricStore.API.System.pipeline/1.

psetex(key, milliseconds, value)

See FerricStore.API.Strings.psetex/3.

pttl(key)

See FerricStore.API.Generic.pttl/1.

randomkey()

See FerricStore.API.Generic.randomkey/0.

ratelimit_add(key, window_ms, max, count \\ 1)

See FerricStore.API.Locks.ratelimit_add/4.

ready?()

@spec ready?() :: boolean()

Returns true if FerricStore is ready to serve requests.

Examples

iex> FerricStore.ready?()
true

rename(source, destination)

See FerricStore.API.Generic.rename/2.

renamenx(source, destination)

See FerricStore.API.Generic.renamenx/2.

rpop(key, count \\ 1)

See FerricStore.API.Lists.rpop/2.

rpush(key, elements)

See FerricStore.API.Lists.rpush/2.

sadd(key, members)

See FerricStore.API.Sets.sadd/2.

scard(key)

See FerricStore.API.Sets.scard/1.

sdiff(keys)

See FerricStore.API.Sets.sdiff/1.

sdiffstore(destination, keys)

See FerricStore.API.Sets.sdiffstore/2.

set(key, value, opts \\ [])

@spec set(key(), value(), set_opts()) ::
  :ok | {:ok, value() | nil} | nil | write_error()

See FerricStore.API.Strings.set/3.

setbit(key, offset, bit_value)

See FerricStore.API.Bitmap.setbit/3.

setex(key, seconds, value)

See FerricStore.API.Strings.setex/3.

setnx(key, value)

See FerricStore.API.Strings.setnx/2.

setrange(key, offset, value)

See FerricStore.API.Strings.setrange/3.

shutdown()

@spec shutdown() :: :ok

Gracefully shuts down FerricStore, flushing all pending data to disk.

Flushes Raft batchers, BitcaskWriters, shard pending writes, and triggers a WAL rollover. Call before stopping the application to ensure zero data loss.

Examples

FerricStore.shutdown()
Application.stop(:ferricstore)

sinter(keys)

See FerricStore.API.Sets.sinter/1.

sintercard(keys, opts \\ [])

See FerricStore.API.Sets.sintercard/2.

sinterstore(destination, keys)

See FerricStore.API.Sets.sinterstore/2.

sismember(key, member)

See FerricStore.API.Sets.sismember/2.

smembers(key)

See FerricStore.API.Sets.smembers/1.

smismember(key, members)

See FerricStore.API.Sets.smismember/2.

spop(key, count \\ nil)

See FerricStore.API.Sets.spop/2.

srandmember(key, count \\ nil)

See FerricStore.API.Sets.srandmember/2.

srem(key, members)

See FerricStore.API.Sets.srem/2.

strlen(key)

See FerricStore.API.Strings.strlen/1.

sunion(keys)

See FerricStore.API.Sets.sunion/1.

sunionstore(destination, keys)

See FerricStore.API.Sets.sunionstore/2.

tdigest_add(key, values)

See FerricStore.API.Probabilistic.tdigest_add/2.

tdigest_byrank(key, ranks)

See FerricStore.API.Probabilistic.tdigest_byrank/2.

tdigest_byrevrank(key, ranks)

See FerricStore.API.Probabilistic.tdigest_byrevrank/2.

tdigest_cdf(key, values)

See FerricStore.API.Probabilistic.tdigest_cdf/2.

tdigest_create(key)

See FerricStore.API.Probabilistic.tdigest_create/1.

tdigest_info(key)

See FerricStore.API.Probabilistic.tdigest_info/1.

tdigest_max(key)

See FerricStore.API.Probabilistic.tdigest_max/1.

tdigest_min(key)

See FerricStore.API.Probabilistic.tdigest_min/1.

tdigest_quantile(key, quantiles)

See FerricStore.API.Probabilistic.tdigest_quantile/2.

tdigest_rank(key, values)

See FerricStore.API.Probabilistic.tdigest_rank/2.

tdigest_reset(key)

See FerricStore.API.Probabilistic.tdigest_reset/1.

tdigest_revrank(key, values)

See FerricStore.API.Probabilistic.tdigest_revrank/2.

tdigest_trimmed_mean(key, lo, hi)

See FerricStore.API.Probabilistic.tdigest_trimmed_mean/3.

topk_add(key, elements)

See FerricStore.API.Probabilistic.topk_add/2.

topk_info(key)

See FerricStore.API.Probabilistic.topk_info/1.

topk_list(key)

See FerricStore.API.Probabilistic.topk_list/1.

topk_query(key, elements)

See FerricStore.API.Probabilistic.topk_query/2.

topk_reserve(key, k)

See FerricStore.API.Probabilistic.topk_reserve/2.

ttl(key)

See FerricStore.API.Generic.ttl/1.

type(key)

See FerricStore.API.Generic.type/1.

unlock(key, owner)

See FerricStore.API.Locks.unlock/2.

xadd(key, fields)

See FerricStore.API.Streams.xadd/2.

xlen(key)

See FerricStore.API.Streams.xlen/1.

xrange(key, start, stop, opts \\ [])

See FerricStore.API.Streams.xrange/4.

xrevrange(key, stop, start, opts \\ [])

See FerricStore.API.Streams.xrevrange/4.

xtrim(key, opts)

See FerricStore.API.Streams.xtrim/2.

zadd(key, score_member_pairs)

See FerricStore.API.SortedSets.zadd/2.

zcard(key)

See FerricStore.API.SortedSets.zcard/1.

zcount(key, min, max)

See FerricStore.API.SortedSets.zcount/3.

zincrby(key, increment, member)

See FerricStore.API.SortedSets.zincrby/3.

zmscore(key, members)

See FerricStore.API.SortedSets.zmscore/2.

zpopmax(key, count \\ 1)

See FerricStore.API.SortedSets.zpopmax/2.

zpopmin(key, count \\ 1)

See FerricStore.API.SortedSets.zpopmin/2.

zrandmember(key, count \\ nil)

See FerricStore.API.SortedSets.zrandmember/2.

zrange(key, start, stop, opts \\ [])

See FerricStore.API.SortedSets.zrange/4.

zrangebyscore(key, min, max, opts \\ [])

See FerricStore.API.SortedSets.zrangebyscore/4.

zrank(key, member)

See FerricStore.API.SortedSets.zrank/2.

zrem(key, members)

See FerricStore.API.SortedSets.zrem/2.

zrevrank(key, member)

See FerricStore.API.SortedSets.zrevrank/2.

zscore(key, member)

See FerricStore.API.SortedSets.zscore/2.