Bedrock.Cluster behaviour (bedrock v0.5.2)
View SourceDefines a cluster behaviour and provides macros for creating cluster modules.
A cluster is a distributed group of nodes that coordinate to provide a consistent, distributed key-value store.
Summary
Functions
Get the OTP name for the cluster with the given name.
Get the OTP name for a component within the cluster with the given name.
Types
@type capability() :: :coordination | :log | :materializer | :resolution
@type log() :: Bedrock.DataPlane.Log.ref()
@type materializer() :: Bedrock.DataPlane.Materializer.ref()
@type name() :: String.t()
@type t() :: module()
@type transaction() :: Bedrock.DataPlane.Transaction.encoded()
@type version() :: Bedrock.version()
Callbacks
@callback config!() :: Bedrock.ControlPlane.Config.t()
@callback coordinator!() :: Bedrock.ControlPlane.Coordinator.ref()
@callback coordinator_nodes!() :: [node()]
@callback coordinator_ping_timeout_in_ms() :: non_neg_integer()
@callback fetch_config() :: {:ok, Bedrock.ControlPlane.Config.t()} | {:error, :unavailable}
@callback fetch_coordinator() :: {:ok, Bedrock.ControlPlane.Coordinator.ref()} | {:error, :unavailable}
@callback fetch_coordinator_nodes() :: {:ok, [node()]} | {:error, :unavailable}
@callback fetch_link() :: {:ok, Bedrock.Cluster.Link.ref()} | {:error, :unavailable}
@callback fetch_transaction_system_layout() :: {:ok, Bedrock.ControlPlane.Config.TransactionSystemLayout.t()} | {:error, :unavailable}
@callback gateway_ping_timeout_in_ms() :: non_neg_integer()
@callback link!() :: Bedrock.Cluster.Link.ref()
@callback name() :: String.t()
@callback node_capabilities() :: [capability()]
@callback node_config() :: Keyword.t()
@callback otp_name() :: atom()
@callback path_to_descriptor() :: Path.t()
@callback transaction_system_layout!() :: Bedrock.ControlPlane.Config.TransactionSystemLayout.t()