diff --git a/rustfs/src/table_catalog.rs b/rustfs/src/table_catalog.rs
index c4a6ea240..873ee86ce 100644
--- a/rustfs/src/table_catalog.rs
+++ b/rustfs/src/table_catalog.rs
@@ -20,13 +20,26 @@
#![allow(dead_code)]
-use std::{collections::BTreeMap, fmt};
+use std::{
+ collections::{BTreeMap, BTreeSet},
+ fmt,
+ sync::Arc,
+};
+use http::HeaderMap;
use rustfs_ecstore::bucket::{
metadata::{BUCKET_TABLE_CONFIG, BUCKET_TABLE_RESERVED_PREFIX},
metadata_sys,
};
-use serde::{Deserialize, Serialize};
+use rustfs_ecstore::error::StorageError;
+use rustfs_ecstore::{
+ set_disk::get_lock_acquire_timeout,
+ store_api::{HTTPPreconditions, ObjectOptions, PutObjReader, StorageAPI},
+};
+use serde::{Deserialize, Serialize, de::DeserializeOwned};
+use sha2::{Digest, Sha256};
+use tokio::io::AsyncReadExt;
+use uuid::Uuid;
pub(crate) const TABLE_BUCKET_MARKER_CONFIG: &str = BUCKET_TABLE_CONFIG;
pub(crate) const RESERVED_CATALOG_OBJECT_MESSAGE: &str = "Object key is reserved for the table catalog";
@@ -47,6 +60,13 @@ const TABLE_MARKER_FILE: &str = "table.json";
const CURRENT_POINTER_FILE: &str = "current.json";
const LIFECYCLE_FILE: &str = "lifecycle.json";
const METADATA_DIR: &str = "metadata";
+const CATALOG_ROOT: &str = "catalog";
+const TABLE_BUCKET_ENTRY_FILE: &str = "table-bucket.json";
+const NAMESPACE_ENTRY_FILE: &str = "namespace-entry.json";
+const TABLE_ENTRY_FILE: &str = "table-entry.json";
+const COMMIT_LOG_ROOT: &str = "commits";
+const COMMIT_IDEMPOTENCY_ROOT: &str = "commit-idempotency";
+const TABLE_CATALOG_LIST_MAX_KEYS: i32 = 1000;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CatalogIdentifierError {
@@ -170,6 +190,7 @@ pub(crate) struct TableEntry {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub(crate) enum CommitLogStatus {
+ Staged,
Committed,
Failed,
}
@@ -267,15 +288,743 @@ pub(crate) trait TableCatalogStore: Send + Sync {
async fn drop_table(&self, table_bucket: &str, namespace: &str, table: &str) -> TableCatalogStoreResult<()>;
- async fn get_commit_by_id(&self, table_id: &str, commit_id: &str) -> TableCatalogStoreResult