summaryrefslogtreecommitdiff
path: root/rola-utils/constants/src/bucket.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-18 20:56:05 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-18 20:56:05 +0800
commit68daa10abfe3015beca966825d32cf67c9f5d5d7 (patch)
treec28f0470240e7cdc3748cee57ef74353514c47b7 /rola-utils/constants/src/bucket.rs
parent669898193bebeadc975881bee496fe0239df76a0 (diff)
feat(bucket): implement bucket initialization and logging infrastructure
Add bucket init logic with directory structure creation and log macros for tracing
Diffstat (limited to 'rola-utils/constants/src/bucket.rs')
-rw-r--r--rola-utils/constants/src/bucket.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/rola-utils/constants/src/bucket.rs b/rola-utils/constants/src/bucket.rs
new file mode 100644
index 0000000..e2ebff2
--- /dev/null
+++ b/rola-utils/constants/src/bucket.rs
@@ -0,0 +1,38 @@
+#[shared_macros::constants]
+mod consts {
+ /// Full object storage pool directory
+ pub const DIR_BUCKET_OBJ: &str = "./objects/";
+
+ /// Full compressed object storage pool directory
+ pub const DIR_BUCKET_COMPRESSED_OBJ: &str = "./compressed-objects/";
+
+ /// Incremental object fragment storage pool directory
+ pub const DIR_BUCKET_DELTA: &str = "./delta-objects/";
+
+ /// Version information storage directory
+ pub const DIR_BUCKET_ID_REVS: &str = "./revs/";
+
+ /// Tag storage directory, used to record tags for easy file location
+ pub const DIR_BUCKET_ID_TAGS: &str = "./tags/";
+
+ /// Full object file path template
+ pub const FILE_BUCKET_OBJ: &str = "./objects/{slice1}/{slice2}/{fullname}";
+
+ /// Full compressed object file path template
+ pub const FILE_BUCKET_COMPRESSED_OBJ: &str =
+ "./compressed-objects/{slice1}/{slice2}/{fullname}";
+
+ /// Incremental object file path template (records change info between the previous delta and the current delta)
+ pub const FILE_BUCKET_DELTA: &str = "./delta-objects/{slice1}/{slice2}/{fullname}";
+
+ /// Version information file, records the storage mode, pointed object, and its log offset for all versions of a given file ID (append-only)
+ pub const FILE_BUCKET_ID_REV: &str = "./revs/{file_id}.v";
+
+ /// Version log file, records all operation logs for a given file ID (append-only)
+ pub const FILE_BUCKET_ID_REV_LOG: &str = "./revs/{file_id}.log";
+
+ /// Tag file, internally points to a file_id
+ pub const FILE_BUCKET_ID_TAG: &str = "./tags/{tag_name}";
+}
+
+pub use consts::*;