layout: prepare for write sets

This commit is contained in:
Alex Auvolat
2023-11-14 14:28:16 +01:00
parent 866196750f
commit 3b361d2959
13 changed files with 64 additions and 48 deletions
+7 -2
View File
@@ -27,6 +27,11 @@ pub struct TableFullReplication {
}
impl TableReplication for TableFullReplication {
fn storage_nodes(&self, _hash: &Hash) -> Vec<Uuid> {
let layout = self.system.cluster_layout();
layout.current().all_nodes().to_vec()
}
fn read_nodes(&self, _hash: &Hash) -> Vec<Uuid> {
vec![self.system.id]
}
@@ -34,8 +39,8 @@ impl TableReplication for TableFullReplication {
1
}
fn write_nodes(&self, _hash: &Hash) -> Vec<Uuid> {
self.system.cluster_layout().current().all_nodes().to_vec()
fn write_sets(&self, hash: &Hash) -> Vec<Vec<Uuid>> {
vec![self.storage_nodes(hash)]
}
fn write_quorum(&self) -> usize {
let nmembers = self.system.cluster_layout().current().all_nodes().len();