ExHashRing.Info (ex_hash_ring v7.0.0)

View Source

Provides an interface for querying information about Rings.

Each Ring has some associated information that is available at all times to aid in performing client-context queries into the underlying ETS table.non_neg_integer()

Summary

Types

For any ring information can be looked up that will provide an entry containing specifics about the table holding the ring data, the configured history depth, sizes for each generation in the history, the current generation, and any overrides that should be applied during lookup.

t()

Functions

Returns a specification to start this module under a supervisor.

Retrieves the info entry for the specified ring.

Callback implementation for GenServer.init/1.

Sets the info entry for the specified ring.

Types

entry()

@type entry() ::
  {table :: :ets.tid(), depth :: ExHashRing.Ring.depth(),
   sizes :: [ExHashRing.Ring.size()],
   generation :: ExHashRing.Ring.generation(),
   overrides :: ExHashRing.Ring.overrides()}

For any ring information can be looked up that will provide an entry containing specifics about the table holding the ring data, the configured history depth, sizes for each generation in the history, the current generation, and any overrides that should be applied during lookup.

t()

@type t() :: %ExHashRing.Info{monitored_pids: %{required(pid()) => reference()}}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(name)

@spec get(name :: ExHashRing.Ring.name()) :: {:ok, entry()} | {:error, :no_ring}
@spec get(pid()) :: {:ok, entry()} | {:error, :no_ring}

Retrieves the info entry for the specified ring.

init(atom)

@spec init(:ok) :: {:ok, t()}

Callback implementation for GenServer.init/1.

set(name, entry)

@spec set(name :: ExHashRing.Ring.name(), entry()) :: :ok | {:error, :no_ring}
@spec set(pid(), entry()) :: :ok

Sets the info entry for the specified ring.

start_link()

@spec start_link() :: GenServer.on_start()