use redb::TableDefinition;
use crate::error::ClusterError;
pub(super) const TOPOLOGY_TABLE: TableDefinition<&str, &[u8]> =
TableDefinition::new("_cluster.topology");
pub(super) const ROUTING_TABLE: TableDefinition<&str, &[u8]> =
TableDefinition::new("_cluster.routing");
pub(super) const METADATA_TABLE: TableDefinition<&str, &[u8]> =
TableDefinition::new("_cluster.metadata");
pub(super) const GHOST_TABLE: TableDefinition<&str, &[u8]> =
TableDefinition::new("_cluster.ghosts");
pub(super) const MIGRATION_STATE_TABLE: TableDefinition<&str, &[u8]> =
TableDefinition::new("_cluster.migration_state");
pub(super) const KEY_TOPOLOGY: &str = "topology";
pub(super) const KEY_ROUTING: &str = "routing";
pub(super) const KEY_CLUSTER_ID: &str = "cluster_id";
pub(super) const KEY_CLUSTER_EPOCH: &str = "cluster_epoch";
pub(super) const KEY_CA_CERT: &str = "ca_cert";
pub(super) const KEY_FORMAT_VERSION: &str = "format_version";
pub(super) const CATALOG_FORMAT_VERSION: u32 = 1;
pub(super) fn catalog_err(e: impl std::fmt::Display) -> ClusterError {
ClusterError::Transport {
detail: format!("cluster catalog: {e}"),
}
}