aboutsummaryrefslogtreecommitdiff
path: root/src/model/object_table.rs
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-04-06 05:25:28 +0200
committerAlex Auvolat <alex@adnab.me>2021-04-27 16:47:08 +0200
commit74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88 (patch)
treed33d89915de29eb69e1b527c686f26358fcd2b45 /src/model/object_table.rs
parent16300bbd89235dfb5852413cd451535559664594 (diff)
downloadgarage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.tar.gz
garage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.zip
make most requested changes
Diffstat (limited to 'src/model/object_table.rs')
-rw-r--r--src/model/object_table.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/model/object_table.rs b/src/model/object_table.rs
index 5b026ceb..ff42d065 100644
--- a/src/model/object_table.rs
+++ b/src/model/object_table.rs
@@ -14,13 +14,13 @@ use crate::version_table::*;
/// An object
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub struct Object {
- /// The bucket in which the object is stored
+ /// The bucket in which the object is stored, used as partition key
pub bucket: String,
- /// The key at which the object is stored in its bucket
+ /// The key at which the object is stored in its bucket, used as sorting key
pub key: String,
- /// The list of known versions of the object
+ /// The list of currenty stored versions of the object
versions: Vec<ObjectVersion>,
}
@@ -53,7 +53,7 @@ impl Object {
}
}
- /// Get a list of all versions known for `Object`
+ /// Get a list of currently stored versions of `Object`
pub fn versions(&self) -> &[ObjectVersion] {
&self.versions[..]
}
@@ -77,7 +77,7 @@ pub enum ObjectVersionState {
Uploading(ObjectVersionHeaders),
/// The version is fully received
Complete(ObjectVersionData),
- /// The version was never fully received
+ /// The version uploaded containded errors or the upload was explicitly aborted
Aborted,
}
@@ -105,7 +105,7 @@ impl CRDT for ObjectVersionState {
/// Data about an object version
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug, Serialize, Deserialize)]
pub enum ObjectVersionData {
- /// The version is deleted
+ /// The object was deleted, this Version is a tombstone to mark it as such
DeleteMarker,
/// The object is short, it's stored inlined
Inline(ObjectVersionMeta, #[serde(with = "serde_bytes")] Vec<u8>),
@@ -159,7 +159,7 @@ impl ObjectVersion {
}
}
- /// Is the object version available (received and not deleted)
+ /// Is the object version available (received and not a tombstone)
pub fn is_data(&self) -> bool {
match self.state {
ObjectVersionState::Complete(ObjectVersionData::DeleteMarker) => false,