diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-09 17:32:28 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-09 17:32:28 +0200 |
commit | 101444abb3967770ec378ee09f24eb2845dc091d (patch) | |
tree | 7bb838659014b47d220b27d95765174f5d0ae2fe /src/version_table.rs | |
parent | 4c1aee42d5032066272a051687ac200e874cc13f (diff) | |
download | garage-101444abb3967770ec378ee09f24eb2845dc091d.tar.gz garage-101444abb3967770ec378ee09f24eb2845dc091d.zip |
Some progress
Diffstat (limited to 'src/version_table.rs')
-rw-r--r-- | src/version_table.rs | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/version_table.rs b/src/version_table.rs deleted file mode 100644 index 1542dc42..00000000 --- a/src/version_table.rs +++ /dev/null @@ -1,59 +0,0 @@ -use std::sync::Arc; -use serde::{Serialize, Deserialize}; -use async_trait::async_trait; -use tokio::sync::RwLock; - -use crate::data::*; -use crate::table::*; -use crate::server::Garage; - - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct VersionMeta { - pub bucket: StringKey, - pub key: StringKey, - - pub timestamp: u64, - pub uuid: UUID, - - pub mime_type: String, - pub size: u64, - pub is_complete: bool, - - pub data: VersionData, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub enum VersionData { - DeleteMarker, - Inline(#[serde(with="serde_bytes")] Vec<u8>), - FirstBlock(Hash), -} - -pub struct VersionTable { - pub garage: RwLock<Option<Arc<Garage>>>, -} - -impl Entry<StringKey, StringKey> for VersionMeta { - fn partition_key(&self) -> &StringKey { - &self.bucket - } - fn sort_key(&self) -> &StringKey { - &self.key - } - - fn merge(&mut self, other: &Self) { - unimplemented!() - } -} - -#[async_trait] -impl TableFormat for VersionTable { - type P = StringKey; - type S = StringKey; - type E = VersionMeta; - - async fn updated(&self, old: Option<&Self::E>, new: &Self::E) { - unimplemented!() - } -} |