Bedrock.Cluster.Link (bedrock v0.6.0)
View SourceBidirectional link between a node and the cluster.
The Link is responsible for:
- Discovering and maintaining connection to the cluster Coordinator
- Caching the Transaction System Layout (TSL)
- Subscribing to TSL updates via push notifications
- Providing coordinator reference and TSL to other components
This is a focused service for cluster state management and node-to-cluster connectivity. Transaction creation is handled by Internal.Repo, and service registration is handled directly by Foreman.
Summary
Functions
Fetch the current known coordinator reference. Returns the coordinator if available, or error if coordinator discovery is pending.
Get the current known coordinator reference. Raises if unavailable.
Fetch the cluster descriptor. This includes the coordinator nodes and other cluster configuration.
Get the cluster descriptor. Raises if unavailable.
Fetch the cached Transaction System Layout. Returns the TSL if coordinator is connected and TSL has been received.
Get the cached Transaction System Layout. Raises if unavailable.
Types
Functions
@spec fetch_coordinator(ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}]) :: {:ok, Bedrock.ControlPlane.Coordinator.ref()} | {:error, :unavailable | :timeout | :unknown}
Fetch the current known coordinator reference. Returns the coordinator if available, or error if coordinator discovery is pending.
@spec fetch_coordinator!(ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}]) :: Bedrock.ControlPlane.Coordinator.ref()
Get the current known coordinator reference. Raises if unavailable.
@spec fetch_descriptor(ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}]) :: {:ok, Bedrock.Cluster.Descriptor.t()} | {:error, :unavailable | :timeout | :unknown}
Fetch the cluster descriptor. This includes the coordinator nodes and other cluster configuration.
@spec fetch_descriptor!(ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}]) :: Bedrock.Cluster.Descriptor.t()
Get the cluster descriptor. Raises if unavailable.
@spec fetch_transaction_system_layout( ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}] ) :: {:ok, Bedrock.ControlPlane.Config.TransactionSystemLayout.t()} | {:error, :unavailable | :timeout | :unknown}
Fetch the cached Transaction System Layout. Returns the TSL if coordinator is connected and TSL has been received.
@spec fetch_transaction_system_layout!( ref(), opts :: [{:timeout_in_ms, Bedrock.timeout_in_ms()}] ) :: Bedrock.ControlPlane.Config.TransactionSystemLayout.t()
Get the cached Transaction System Layout. Raises if unavailable.