use std::time::Duration;
use garage_rpc::layout::*;
use garage_util::data::*;
use garage_util::error::Error;
pub trait TableReplication: Send + Sync + 'static {
type WriteSets: AsRef<Vec<Vec<Uuid>>> + AsMut<Vec<Vec<Uuid>>> + Send + Sync + 'static;
const ANTI_ENTROPY_INTERVAL: Duration;
fn storage_nodes(&self, hash: &Hash) -> Result<Vec<Uuid>, Error>;
fn read_nodes(&self, hash: &Hash) -> Result<Vec<Uuid>, Error>;
fn read_quorum(&self) -> Result<usize, Error>;
fn write_sets(&self, hash: &Hash) -> Result<Self::WriteSets, Error>;
fn write_quorum(&self) -> Result<usize, Error>;
fn partition_of(&self, hash: &Hash) -> Result<Partition, Error>;
fn sync_partitions(&self) -> Result<SyncPartitions, Error>;
}
#[derive(Debug)]
pub struct SyncPartitions {
pub layout_version: u64,
pub partitions: Vec<SyncPartition>,
}
#[derive(Debug)]
pub struct SyncPartition {
pub partition: Partition,
pub first_hash: Hash,
pub last_hash: Hash,
pub storage_sets: Vec<Vec<Uuid>>,
}