reckon_db_store (reckon_db v1.2.7)

View Source

Khepri store lifecycle management for reckon-db

Manages the Khepri store instance, including: - Starting and stopping the store - Cluster formation (in cluster mode) - Health checks

Summary

Functions

Get the current leader node for the store

Get the store name (for use with khepri operations)

Check if the store is ready

Start the store worker IMPORTANT: We use store_worker_name/1 for gen_server registration to avoid conflicting with Khepri's internal naming. Khepri uses the StoreId for its Ra cluster and process registration.

Types

store_config/0

-type store_config() ::
          #store_config{store_id :: atom(),
                        data_dir :: string(),
                        mode :: single | cluster,
                        timeout :: pos_integer(),
                        writer_pool_size :: pos_integer(),
                        reader_pool_size :: pos_integer(),
                        gateway_pool_size :: pos_integer(),
                        options :: map()}.

Functions

get_leader(StoreId)

-spec get_leader(atom()) -> {ok, node()} | {error, term()}.

Get the current leader node for the store

get_store(StoreId)

-spec get_store(atom()) -> atom().

Get the store name (for use with khepri operations)

is_ready(StoreId)

-spec is_ready(atom()) -> boolean().

Check if the store is ready

start_link(Store_config)

-spec start_link(store_config()) -> {ok, pid()} | {error, term()}.

Start the store worker IMPORTANT: We use store_worker_name/1 for gen_server registration to avoid conflicting with Khepri's internal naming. Khepri uses the StoreId for its Ra cluster and process registration.