aboutsummaryrefslogtreecommitdiff
path: root/src/table/replication/fullcopy.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-16 12:18:03 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-16 12:18:03 +0100
commit2a41b8238496dfeac5ee0f273445299cbd112ff6 (patch)
tree1c65e8eeaea6ba5124600d33ad98e62b5e13ab53 /src/table/replication/fullcopy.rs
parent0aad2f2e066b5914ac94bb319e7679e2e7761b2b (diff)
downloadgarage-2a41b8238496dfeac5ee0f273445299cbd112ff6.tar.gz
garage-2a41b8238496dfeac5ee0f273445299cbd112ff6.zip
Simpler Merkle & sync
Diffstat (limited to 'src/table/replication/fullcopy.rs')
-rw-r--r--src/table/replication/fullcopy.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/table/replication/fullcopy.rs b/src/table/replication/fullcopy.rs
index aea8c1f3..bd658f63 100644
--- a/src/table/replication/fullcopy.rs
+++ b/src/table/replication/fullcopy.rs
@@ -1,7 +1,7 @@
use std::sync::Arc;
use garage_rpc::membership::System;
-use garage_rpc::ring::Ring;
+use garage_rpc::ring::*;
use garage_util::data::*;
use crate::replication::*;
@@ -19,10 +19,6 @@ impl TableReplication for TableFullReplication {
// Advantage: do all reads locally, extremely fast
// Inconvenient: only suitable to reasonably small tables
- fn partition_of(&self, _hash: &Hash) -> u16 {
- 0u16
- }
-
fn read_nodes(&self, _hash: &Hash) -> Vec<UUID> {
vec![self.system.id]
}
@@ -46,9 +42,10 @@ impl TableReplication for TableFullReplication {
self.max_faults
}
- fn split_points(&self, _ring: &Ring) -> Vec<Hash> {
- let mut ret = vec![];
- ret.push([0u8; 32].into());
- ret
+ fn partition_of(&self, _hash: &Hash) -> Partition {
+ 0u16
+ }
+ fn partitions(&self) -> Vec<(Partition, Hash)> {
+ vec![(0u16, [0u8; 32].into())]
}
}