feat: import datanode

This commit is contained in:
evenyag
2025-03-09 15:32:02 +08:00
parent 6ad186a13e
commit 62a333ad09
6 changed files with 14 additions and 3 deletions

1
Cargo.lock generated
View File

@@ -11228,6 +11228,7 @@ dependencies = [
"common-macro", "common-macro",
"common-meta", "common-meta",
"common-recordbatch", "common-recordbatch",
"datanode",
"datatypes", "datatypes",
"futures", "futures",
"futures-util", "futures-util",

View File

@@ -25,6 +25,6 @@ pub mod heartbeat;
pub mod metrics; pub mod metrics;
pub mod region_server; pub mod region_server;
pub mod service; pub mod service;
mod store; pub mod store;
#[cfg(any(test, feature = "testing"))] #[cfg(any(test, feature = "testing"))]
pub mod tests; pub mod tests;

View File

@@ -15,7 +15,7 @@
//! object storage utilities //! object storage utilities
mod azblob; mod azblob;
mod fs; pub mod fs;
mod gcs; mod gcs;
mod oss; mod oss;
mod s3; mod s3;

View File

@@ -24,7 +24,8 @@ use crate::config::FileConfig;
use crate::error::{self, Result}; use crate::error::{self, Result};
use crate::store; use crate::store;
pub(crate) async fn new_fs_object_store( /// A helper function to create a file system object store.
pub async fn new_fs_object_store(
data_home: &str, data_home: &str,
_file_config: &FileConfig, _file_config: &FileConfig,
) -> Result<ObjectStore> { ) -> Result<ObjectStore> {

View File

@@ -13,6 +13,7 @@ common-error.workspace = true
common-macro.workspace = true common-macro.workspace = true
common-meta.workspace = true common-meta.workspace = true
common-recordbatch.workspace = true common-recordbatch.workspace = true
datanode.workspace = true
datatypes.workspace = true datatypes.workspace = true
futures.workspace = true futures.workspace = true
futures-util.workspace = true futures-util.workspace = true

View File

@@ -73,6 +73,13 @@ pub enum Error {
#[snafu(implicit)] #[snafu(implicit)]
location: Location, location: Location,
}, },
#[snafu(display("Datanode error"))]
Datanode {
source: datanode::error::Error,
#[snafu(implicit)]
location: Location,
},
} }
pub type Result<T, E = Error> = std::result::Result<T, E>; pub type Result<T, E = Error> = std::result::Result<T, E>;
@@ -87,6 +94,7 @@ impl ErrorExt for Error {
Error::MissingTable { .. } => StatusCode::TableNotFound, Error::MissingTable { .. } => StatusCode::TableNotFound,
Error::MissingColumn { .. } => StatusCode::TableColumnNotFound, Error::MissingColumn { .. } => StatusCode::TableColumnNotFound,
Error::Mito { source, .. } => source.status_code(), Error::Mito { source, .. } => source.status_code(),
Error::Datanode { source, .. } => source.status_code(),
} }
} }