Anoma.Node.Transaction.Shard.Supervisor (Anoma v0.35.1)

I am the dynamic supervisor for Anoma.Node.Transaction.Shard processes.

I start with no children. Children (shards) are started dynamically either during initial node setup based on a provided schema or later via start_shard/3.

I record key-to-shard mappings in Mnesia (Anoma.Tables.table_shard_key_map/1) for future replay support. These mappings are not currently read in production.

Public API

Summary

Functions

Returns a specification to start this module under a supervisor.

I dynamically start a new shard process for the given key.

Types

initial_value()

@type initial_value() :: any()

key()

@type key() :: [binary()]

schema()

@type schema() :: [key() | {key(), initial_value()}]

startup_options()

@type startup_options() ::
  {:node_id, String.t()} | {:strategy, :one_per_key} | {:schema, schema()}

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(args)

@spec start_link([startup_options()]) :: Supervisor.on_start()

start_shard(node_id, key, initial_value \\ nil)

@spec start_shard(String.t(), key(), initial_value() | nil) ::
  DynamicSupervisor.on_start_child()

I dynamically start a new shard process for the given key.