aboutsummaryrefslogtreecommitdiff
path: root/src/util/crdt/lww.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-17 11:53:13 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:46:41 +0100
commitb1cfd16913e6957739958ef729b87c1bf3674a5d (patch)
tree781245de967e0c7a14cbdc0f2a610787f3b852d4 /src/util/crdt/lww.rs
parent5db600e2316b80102e3fd4df9e8974c9586aec9c (diff)
downloadgarage-b1cfd16913e6957739958ef729b87c1bf3674a5d.tar.gz
garage-b1cfd16913e6957739958ef729b87c1bf3674a5d.zip
New buckets for 0.6.0: small fixes, including:
- ensure bucket names are correct aws s3 names - when making aliases, ensure timestamps of links in both ways are the same - fix small remarks by trinity - don't have a separate website_access field
Diffstat (limited to 'src/util/crdt/lww.rs')
-rw-r--r--src/util/crdt/lww.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/crdt/lww.rs b/src/util/crdt/lww.rs
index bc686e05..99bd8e7c 100644
--- a/src/util/crdt/lww.rs
+++ b/src/util/crdt/lww.rs
@@ -61,7 +61,7 @@ where
///
/// Compared to new, the CRDT's timestamp is not set to now
/// but must be set to the previous, non-compatible, CRDT's timestamp.
- pub fn migrate_from_raw(ts: u64, value: T) -> Self {
+ pub fn raw(ts: u64, value: T) -> Self {
Self { ts, v: value }
}
@@ -77,6 +77,11 @@ where
self.v = new_value;
}
+ /// Get the timestamp currently associated with the value
+ pub fn timestamp(&self) -> u64 {
+ self.ts
+ }
+
/// Get the CRDT value
pub fn get(&self) -> &T {
&self.v