mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-12 15:26:52 +00:00
Make table name a const in trait
This commit is contained in:
@@ -44,6 +44,8 @@ pub struct BlockRefTable {
|
||||
}
|
||||
|
||||
impl TableSchema for BlockRefTable {
|
||||
const TABLE_NAME: &'static str = "block_ref";
|
||||
|
||||
type P = Hash;
|
||||
type S = Uuid;
|
||||
type E = BlockRef;
|
||||
|
||||
@@ -114,6 +114,8 @@ impl Crdt for Bucket {
|
||||
pub struct BucketTable;
|
||||
|
||||
impl TableSchema for BucketTable {
|
||||
const TABLE_NAME: &'static str = "bucket";
|
||||
|
||||
type P = EmptyKey;
|
||||
type S = String;
|
||||
type E = Bucket;
|
||||
|
||||
+2
-17
@@ -93,7 +93,6 @@ impl Garage {
|
||||
meta_rep_param.clone(),
|
||||
system.clone(),
|
||||
&db,
|
||||
"block_ref".to_string(),
|
||||
);
|
||||
|
||||
info!("Initialize version_table...");
|
||||
@@ -105,7 +104,6 @@ impl Garage {
|
||||
meta_rep_param.clone(),
|
||||
system.clone(),
|
||||
&db,
|
||||
"version".to_string(),
|
||||
);
|
||||
|
||||
info!("Initialize object_table...");
|
||||
@@ -117,26 +115,13 @@ impl Garage {
|
||||
meta_rep_param,
|
||||
system.clone(),
|
||||
&db,
|
||||
"object".to_string(),
|
||||
);
|
||||
|
||||
info!("Initialize bucket_table...");
|
||||
let bucket_table = Table::new(
|
||||
BucketTable,
|
||||
control_rep_param.clone(),
|
||||
system.clone(),
|
||||
&db,
|
||||
"bucket".to_string(),
|
||||
);
|
||||
let bucket_table = Table::new(BucketTable, control_rep_param.clone(), system.clone(), &db);
|
||||
|
||||
info!("Initialize key_table_table...");
|
||||
let key_table = Table::new(
|
||||
KeyTable,
|
||||
control_rep_param,
|
||||
system.clone(),
|
||||
&db,
|
||||
"key".to_string(),
|
||||
);
|
||||
let key_table = Table::new(KeyTable, control_rep_param, system.clone(), &db);
|
||||
|
||||
info!("Initialize Garage...");
|
||||
let garage = Arc::new(Self {
|
||||
|
||||
@@ -120,6 +120,8 @@ pub enum KeyFilter {
|
||||
}
|
||||
|
||||
impl TableSchema for KeyTable {
|
||||
const TABLE_NAME: &'static str = "key";
|
||||
|
||||
type P = EmptyKey;
|
||||
type S = String;
|
||||
type E = Key;
|
||||
|
||||
@@ -217,6 +217,8 @@ pub struct ObjectTable {
|
||||
}
|
||||
|
||||
impl TableSchema for ObjectTable {
|
||||
const TABLE_NAME: &'static str = "object";
|
||||
|
||||
type P = String;
|
||||
type S = String;
|
||||
type E = Object;
|
||||
|
||||
@@ -114,6 +114,8 @@ pub struct VersionTable {
|
||||
}
|
||||
|
||||
impl TableSchema for VersionTable {
|
||||
const TABLE_NAME: &'static str = "version";
|
||||
|
||||
type P = Hash;
|
||||
type S = EmptyKey;
|
||||
type E = Version;
|
||||
|
||||
Reference in New Issue
Block a user