FerricStore.Impl (ferricstore v0.3.5)

Copy Markdown View Source

Elixir-native implementation of all FerricStore data-type operations, delegating to Router and command handlers.

Summary

Functions

Functions

append(ctx, key, suffix)

@spec append(FerricStore.Instance.t(), binary(), binary()) :: {:ok, non_neg_integer()}

bf_add(ctx, key, element)

@spec bf_add(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

bf_card(ctx, key)

@spec bf_card(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

bf_exists(ctx, key, element)

@spec bf_exists(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

bf_info(ctx, key)

@spec bf_info(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

bf_madd(ctx, key, elements)

@spec bf_madd(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

bf_mexists(ctx, key, elements)

@spec bf_mexists(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

bf_reserve(ctx, key, error_rate, capacity)

@spec bf_reserve(FerricStore.Instance.t(), binary(), number(), pos_integer()) ::
  :ok | {:error, binary()}

cf_add(ctx, key, element)

@spec cf_add(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_addnx(ctx, key, element)

@spec cf_addnx(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_count(ctx, key, element)

@spec cf_count(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_del(ctx, key, element)

@spec cf_del(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_exists(ctx, key, element)

@spec cf_exists(FerricStore.Instance.t(), binary(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_info(ctx, key)

@spec cf_info(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

cf_mexists(ctx, key, elements)

@spec cf_mexists(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

cf_reserve(ctx, key, capacity)

@spec cf_reserve(FerricStore.Instance.t(), binary(), pos_integer()) ::
  :ok | {:error, binary()}

cms_incrby(ctx, key, pairs)

@spec cms_incrby(FerricStore.Instance.t(), binary(), [{binary(), pos_integer()}]) ::
  {:ok, term()} | {:error, binary()}

cms_info(ctx, key)

@spec cms_info(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

cms_initbydim(ctx, key, width, depth)

@spec cms_initbydim(FerricStore.Instance.t(), binary(), pos_integer(), pos_integer()) ::
  :ok | {:error, binary()}

cms_initbyprob(ctx, key, error, probability)

@spec cms_initbyprob(FerricStore.Instance.t(), binary(), number(), number()) ::
  :ok | {:error, binary()}

cms_merge(ctx, dest, sources, opts \\ [])

@spec cms_merge(FerricStore.Instance.t(), binary(), [binary()], keyword()) ::
  :ok | {:error, binary()}

cms_query(ctx, key, elements)

@spec cms_query(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

dbsize(ctx)

@spec dbsize(FerricStore.Instance.t()) :: {:ok, non_neg_integer()}

del(ctx, keys)

@spec del(FerricStore.Instance.t(), [binary()]) :: {:ok, non_neg_integer()}

exists?(ctx, key)

@spec exists?(FerricStore.Instance.t(), binary()) :: {:ok, boolean()}

expire(ctx, key, seconds)

@spec expire(FerricStore.Instance.t(), binary(), integer()) ::
  0 | 1 | {:error, binary()}

flushdb(ctx)

@spec flushdb(FerricStore.Instance.t()) :: :ok

get(ctx, key, opts \\ [])

@spec get(FerricStore.Instance.t(), binary(), keyword()) :: {:ok, binary() | nil}

getdel(ctx, key)

@spec getdel(FerricStore.Instance.t(), binary()) :: {:ok, binary() | nil}

getex(ctx, key, opts)

@spec getex(FerricStore.Instance.t(), binary(), keyword()) :: {:ok, binary() | nil}

getrange(ctx, key, start, stop)

@spec getrange(FerricStore.Instance.t(), binary(), integer(), integer()) ::
  {:ok, binary()}

getset(ctx, key, value)

@spec getset(FerricStore.Instance.t(), binary(), binary()) :: {:ok, binary() | nil}

hdel(ctx, key, fields)

@spec hdel(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

hexists(ctx, key, field)

@spec hexists(FerricStore.Instance.t(), binary(), binary()) :: {:ok, boolean()}

hget(ctx, key, field)

@spec hget(FerricStore.Instance.t(), binary(), binary()) :: {:ok, binary() | nil}

hgetall(ctx, key)

@spec hgetall(FerricStore.Instance.t(), binary()) :: {:ok, map()} | {:error, binary()}

hincrby(ctx, key, field, amount)

@spec hincrby(FerricStore.Instance.t(), binary(), binary(), integer()) ::
  integer() | {:error, binary()}

hlen(ctx, key)

@spec hlen(FerricStore.Instance.t(), binary()) :: {:ok, term()} | {:error, binary()}

hset(ctx, key, fields)

@spec hset(FerricStore.Instance.t(), binary(), map()) ::
  {:ok, term()} | {:error, binary()}

incr(ctx, key, delta)

@spec incr(FerricStore.Instance.t(), binary(), integer()) ::
  {:ok, integer()} | {:error, binary()}

incr_float(ctx, key, delta)

@spec incr_float(FerricStore.Instance.t(), binary(), float()) ::
  {:ok, binary()} | {:error, binary()}

keys(ctx, opts \\ [])

@spec keys(
  FerricStore.Instance.t(),
  keyword()
) :: {:ok, [binary()]}

llen(ctx, key)

@spec llen(FerricStore.Instance.t(), binary()) :: {:ok, term()} | {:error, binary()}

lpop(ctx, key, count)

@spec lpop(FerricStore.Instance.t(), binary(), pos_integer()) ::
  {:ok, term()} | {:error, binary()}

lpush(ctx, key, values)

@spec lpush(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

lrange(ctx, key, start, stop)

@spec lrange(FerricStore.Instance.t(), binary(), integer(), integer()) ::
  {:ok, term()} | {:error, binary()}

mget(ctx, keys)

@spec mget(FerricStore.Instance.t(), [binary()]) :: {:ok, [binary() | nil]}

mset(ctx, pairs)

@spec mset(FerricStore.Instance.t(), [{binary(), binary()}]) :: :ok

persist(ctx, key)

@spec persist(FerricStore.Instance.t(), binary()) :: 0 | 1

pexpire(ctx, key, milliseconds)

@spec pexpire(FerricStore.Instance.t(), binary(), integer()) ::
  0 | 1 | {:error, binary()}

psetex(ctx, key, milliseconds, value)

@spec psetex(FerricStore.Instance.t(), binary(), pos_integer(), binary()) :: :ok

pttl(ctx, key)

@spec pttl(FerricStore.Instance.t(), binary()) :: {:ok, integer()}

rpop(ctx, key, count)

@spec rpop(FerricStore.Instance.t(), binary(), pos_integer()) ::
  {:ok, term()} | {:error, binary()}

rpush(ctx, key, values)

@spec rpush(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

sadd(ctx, key, members)

@spec sadd(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

scard(ctx, key)

@spec scard(FerricStore.Instance.t(), binary()) :: {:ok, term()} | {:error, binary()}

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

@spec set(FerricStore.Instance.t(), binary(), binary(), keyword()) ::
  :ok | {:ok, binary() | nil} | {:ok, boolean()}

setex(ctx, key, seconds, value)

@spec setex(FerricStore.Instance.t(), binary(), pos_integer(), binary()) :: :ok

setnx(ctx, key, value)

@spec setnx(FerricStore.Instance.t(), binary(), binary()) :: {:ok, boolean()}

setrange(ctx, key, offset, value)

@spec setrange(FerricStore.Instance.t(), binary(), non_neg_integer(), binary()) ::
  {:ok, non_neg_integer()}

sismember(ctx, key, member)

@spec sismember(FerricStore.Instance.t(), binary(), binary()) :: {:ok, boolean()}

smembers(ctx, key)

@spec smembers(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

spop(ctx, key, count)

@spec spop(FerricStore.Instance.t(), binary(), pos_integer()) ::
  {:ok, term()} | {:error, binary()}

srem(ctx, key, members)

@spec srem(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

strlen(ctx, key)

@spec strlen(FerricStore.Instance.t(), binary()) :: {:ok, non_neg_integer()}

tdigest_add(ctx, key, values)

@spec tdigest_add(FerricStore.Instance.t(), binary(), [number()]) ::
  :ok | {:error, binary()}

tdigest_cdf(ctx, key, values)

@spec tdigest_cdf(FerricStore.Instance.t(), binary(), [number()]) ::
  {:ok, term()} | {:error, binary()}

tdigest_create(ctx, key, opts \\ [])

@spec tdigest_create(FerricStore.Instance.t(), binary(), keyword()) ::
  :ok | {:error, binary()}

tdigest_info(ctx, key)

@spec tdigest_info(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

tdigest_max(ctx, key)

@spec tdigest_max(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

tdigest_min(ctx, key)

@spec tdigest_min(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

tdigest_quantile(ctx, key, quantiles)

@spec tdigest_quantile(FerricStore.Instance.t(), binary(), [number()]) ::
  {:ok, term()} | {:error, binary()}

tdigest_reset(ctx, key)

@spec tdigest_reset(FerricStore.Instance.t(), binary()) :: :ok | {:error, binary()}

topk_add(ctx, key, elements)

@spec topk_add(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

topk_info(ctx, key)

@spec topk_info(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

topk_list(ctx, key)

@spec topk_list(FerricStore.Instance.t(), binary()) ::
  {:ok, term()} | {:error, binary()}

topk_query(ctx, key, elements)

@spec topk_query(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

topk_reserve(ctx, key, k)

@spec topk_reserve(FerricStore.Instance.t(), binary(), pos_integer()) ::
  :ok | {:error, binary()}

ttl(ctx, key)

@spec ttl(FerricStore.Instance.t(), binary()) :: {:ok, integer()}

zadd(ctx, key, members)

@spec zadd(FerricStore.Instance.t(), binary(), [{number(), binary()}]) ::
  {:ok, term()} | {:error, binary()}

zcard(ctx, key)

@spec zcard(FerricStore.Instance.t(), binary()) :: {:ok, term()} | {:error, binary()}

zrange(ctx, key, start, stop, opts)

@spec zrange(FerricStore.Instance.t(), binary(), integer(), integer(), keyword()) ::
  {:ok, term()} | {:error, binary()}

zrem(ctx, key, members)

@spec zrem(FerricStore.Instance.t(), binary(), [binary()]) ::
  {:ok, term()} | {:error, binary()}

zscore(ctx, key, member)

@spec zscore(FerricStore.Instance.t(), binary(), binary()) :: {:ok, term()}