Trait garage_table::replication::TableReplication
source · pub trait TableReplication: Send + Sync + 'static {
type WriteSets: AsRef<Vec<Vec<Uuid>>> + AsMut<Vec<Vec<Uuid>>> + Send + Sync + 'static;
// Required methods
fn storage_nodes(&self, hash: &Hash) -> Vec<Uuid>;
fn read_nodes(&self, hash: &Hash) -> Vec<Uuid>;
fn read_quorum(&self) -> usize;
fn write_sets(&self, hash: &Hash) -> Self::WriteSets;
fn write_quorum(&self) -> usize;
fn partition_of(&self, hash: &Hash) -> Partition;
fn sync_partitions(&self) -> SyncPartitions;
}
Expand description
Trait to describe how a table shall be replicated
Required Associated Types§
Required Methods§
sourcefn storage_nodes(&self, hash: &Hash) -> Vec<Uuid>
fn storage_nodes(&self, hash: &Hash) -> Vec<Uuid>
The entire list of all nodes that store a partition
sourcefn read_nodes(&self, hash: &Hash) -> Vec<Uuid>
fn read_nodes(&self, hash: &Hash) -> Vec<Uuid>
Which nodes to send read requests to
sourcefn read_quorum(&self) -> usize
fn read_quorum(&self) -> usize
Responses needed to consider a read succesfull
sourcefn write_sets(&self, hash: &Hash) -> Self::WriteSets
fn write_sets(&self, hash: &Hash) -> Self::WriteSets
Which nodes to send writes to
sourcefn write_quorum(&self) -> usize
fn write_quorum(&self) -> usize
Responses needed to consider a write succesfull in each set
sourcefn partition_of(&self, hash: &Hash) -> Partition
fn partition_of(&self, hash: &Hash) -> Partition
Get partition for data with given hash
sourcefn sync_partitions(&self) -> SyncPartitions
fn sync_partitions(&self) -> SyncPartitions
List of partitions and nodes to sync with in current layout