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§

source

type WriteSets: AsRef<Vec<Vec<Uuid>>> + AsMut<Vec<Vec<Uuid>>> + Send + Sync + 'static

Required Methods§

source

fn storage_nodes(&self, hash: &Hash) -> Vec<Uuid>

The entire list of all nodes that store a partition

source

fn read_nodes(&self, hash: &Hash) -> Vec<Uuid>

Which nodes to send read requests to

source

fn read_quorum(&self) -> usize

Responses needed to consider a read succesfull

source

fn write_sets(&self, hash: &Hash) -> Self::WriteSets

Which nodes to send writes to

source

fn write_quorum(&self) -> usize

Responses needed to consider a write succesfull in each set

source

fn partition_of(&self, hash: &Hash) -> Partition

Get partition for data with given hash

source

fn sync_partitions(&self) -> SyncPartitions

List of partitions and nodes to sync with in current layout

Implementors§