This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new eedb3c64b refactor: Split service alluxio to new crate (#7006)
eedb3c64b is described below
commit eedb3c64b4ac0ea486ff975c9aaf99659863ecda
Author: Eric Zhao <[email protected]>
AuthorDate: Mon Dec 15 15:03:06 2025 +0800
refactor: Split service alluxio to new crate (#7006)
* refactor: Split service alluxio to new crate
* fix: Remove duplicate entry for opendal-service-gcs in Cargo.toml
---
core/Cargo.lock | 14 +++++++
core/Cargo.toml | 11 +++---
core/core/Cargo.toml | 1 -
core/core/src/services/mod.rs | 5 ---
core/services/alluxio/Cargo.toml | 43 ++++++++++++++++++++++
.../alluxio => services/alluxio/src}/backend.rs | 4 +-
.../alluxio => services/alluxio/src}/config.rs | 8 ++--
.../alluxio => services/alluxio/src}/core.rs | 4 +-
.../alluxio => services/alluxio/src}/deleter.rs | 4 +-
.../alluxio => services/alluxio/src}/docs.md | 2 +-
.../alluxio => services/alluxio/src}/error.rs | 4 +-
.../alluxio/mod.rs => services/alluxio/src/lib.rs} | 2 +-
.../alluxio => services/alluxio/src}/lister.rs | 8 ++--
.../alluxio => services/alluxio/src}/writer.rs | 4 +-
core/src/lib.rs | 2 +
15 files changed, 85 insertions(+), 31 deletions(-)
diff --git a/core/Cargo.lock b/core/Cargo.lock
index ac3a7bbd8..c72ae28a1 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -5497,6 +5497,7 @@ dependencies = [
"opendal-layer-throttle",
"opendal-layer-tracing",
"opendal-service-aliyun-drive",
+ "opendal-service-alluxio",
"opendal-service-azblob",
"opendal-service-azdls",
"opendal-service-azfile",
@@ -5818,6 +5819,19 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "opendal-service-alluxio"
+version = "0.55.0"
+dependencies = [
+ "bytes",
+ "ctor",
+ "http 1.4.0",
+ "log",
+ "opendal-core",
+ "serde",
+ "serde_json",
+]
+
[[package]]
name = "opendal-service-azblob"
version = "0.55.0"
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 17e1f361c..1719ef729 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -89,8 +89,8 @@ layers-chaos = ["opendal-core/layers-chaos"]
layers-dtrace = ["opendal-core/layers-dtrace"]
layers-fastmetrics = ["dep:opendal-layer-fastmetrics"]
layers-fastrace = ["dep:opendal-layer-fastrace"]
-layers-metrics = ["dep:opendal-layer-metrics"]
layers-immutable-index = ["dep:opendal-layer-immutable-index"]
+layers-metrics = ["dep:opendal-layer-metrics"]
layers-mime-guess = ["dep:opendal-layer-mime-guess"]
layers-otel-metrics = ["dep:opendal-layer-otelmetrics"]
layers-otel-trace = ["dep:opendal-layer-oteltrace"]
@@ -101,7 +101,7 @@ layers-throttle = ["dep:opendal-layer-throttle"]
layers-tracing = ["dep:opendal-layer-tracing"]
reqwest-rustls-tls = ["opendal-core/reqwest-rustls-tls"]
services-aliyun-drive = ["dep:opendal-service-aliyun-drive"]
-services-alluxio = ["opendal-core/services-alluxio"]
+services-alluxio = ["dep:opendal-service-alluxio"]
services-azblob = ["dep:opendal-service-azblob"]
services-azdls = ["dep:opendal-service-azdls"]
services-azfile = ["dep:opendal-service-azfile"]
@@ -202,22 +202,23 @@ opendal-layer-tail-cut = { path = "layers/tail-cut",
version = "0.55.0", optiona
opendal-layer-throttle = { path = "layers/throttle", version = "0.55.0",
optional = true, default-features = false }
opendal-layer-tracing = { path = "layers/tracing", version = "0.55.0",
optional = true, default-features = false }
opendal-service-aliyun-drive = { path = "services/aliyun-drive", version =
"0.55.0", optional = true, default-features = false }
+opendal-service-alluxio = { path = "services/alluxio", version = "0.55.0",
optional = true, default-features = false }
opendal-service-azblob = { path = "services/azblob", version = "0.55.0",
optional = true, default-features = false }
opendal-service-azdls = { path = "services/azdls", version = "0.55.0",
optional = true, default-features = false }
opendal-service-azfile = { path = "services/azfile", version = "0.55.0",
optional = true, default-features = false }
opendal-service-cloudflare-kv = { path = "services/cloudflare-kv", version =
"0.55.0", optional = true, default-features = false }
-opendal-service-ghac = { path = "services/ghac", version = "0.55.0", optional
= true, default-features = false }
-opendal-service-hdfs-native = { path = "services/hdfs-native", version =
"0.55.0", optional = true, default-features = false }
opendal-service-ftp = { path = "services/ftp", version = "0.55.0", optional =
true, default-features = false }
opendal-service-gcs = { path = "services/gcs", version = "0.55.0", optional =
true, default-features = false }
+opendal-service-ghac = { path = "services/ghac", version = "0.55.0", optional
= true, default-features = false }
+opendal-service-hdfs-native = { path = "services/hdfs-native", version =
"0.55.0", optional = true, default-features = false }
opendal-service-ipfs = { path = "services/ipfs", version = "0.55.0", optional
= true, default-features = false }
opendal-service-moka = { path = "services/moka", version = "0.55.0", optional
= true, default-features = false }
opendal-service-mysql = { path = "services/mysql", version = "0.55.0",
optional = true, default-features = false }
opendal-service-obs = { path = "services/obs", version = "0.55.0", optional =
true, default-features = false }
opendal-service-oss = { path = "services/oss", version = "0.55.0", optional =
true, default-features = false }
opendal-service-postgresql = { path = "services/postgresql", version =
"0.55.0", optional = true, default-features = false }
-opendal-service-sled = { path = "services/sled", version = "0.55.0", optional
= true, default-features = false }
opendal-service-s3 = { path = "services/s3", version = "0.55.0", optional =
true, default-features = false }
+opendal-service-sled = { path = "services/sled", version = "0.55.0", optional
= true, default-features = false }
opendal-service-tikv = { path = "services/tikv", version = "0.55.0", optional
= true, default-features = false }
opendal-service-vercel-blob = { path = "services/vercel-blob", version =
"0.55.0", optional = true, default-features = false }
diff --git a/core/core/Cargo.toml b/core/core/Cargo.toml
index 425c61513..567444bfb 100644
--- a/core/core/Cargo.toml
+++ b/core/core/Cargo.toml
@@ -75,7 +75,6 @@ layers-chaos = ["dep:rand"]
# Enable dtrace support.
layers-dtrace = ["dep:probe"]
-services-alluxio = []
services-b2 = []
services-cacache = ["dep:cacache"]
services-compfs = ["dep:compio"]
diff --git a/core/core/src/services/mod.rs b/core/core/src/services/mod.rs
index 79ca49398..17b3bc053 100644
--- a/core/core/src/services/mod.rs
+++ b/core/core/src/services/mod.rs
@@ -19,11 +19,6 @@
//!
//! More ongoing services support is tracked at
[opendal#5](https://github.com/apache/opendal/issues/5). Please feel free to
submit issues if there are services not covered.
-#[cfg(feature = "services-alluxio")]
-mod alluxio;
-#[cfg(feature = "services-alluxio")]
-pub use alluxio::*;
-
#[cfg(feature = "services-b2")]
mod b2;
#[cfg(feature = "services-b2")]
diff --git a/core/services/alluxio/Cargo.toml b/core/services/alluxio/Cargo.toml
new file mode 100644
index 000000000..fce1c11d0
--- /dev/null
+++ b/core/services/alluxio/Cargo.toml
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+description = "Apache OpenDAL Alluxio service implementation"
+name = "opendal-service-alluxio"
+
+authors = { workspace = true }
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+
+bytes = { workspace = true }
+ctor = { workspace = true }
+http = { workspace = true }
+log = { workspace = true }
+serde = { workspace = true, features = ["derive"] }
+serde_json = { workspace = true }
+
+[dev-dependencies]
diff --git a/core/core/src/services/alluxio/backend.rs
b/core/services/alluxio/src/backend.rs
similarity index 99%
rename from core/core/src/services/alluxio/backend.rs
rename to core/services/alluxio/src/backend.rs
index dcf62eda3..e865dfb15 100644
--- a/core/core/src/services/alluxio/backend.rs
+++ b/core/services/alluxio/src/backend.rs
@@ -29,8 +29,8 @@ use super::error::parse_error;
use super::lister::AlluxioLister;
use super::writer::AlluxioWriter;
use super::writer::AlluxioWriters;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// [Alluxio](https://www.alluxio.io/) services support.
#[doc = include_str!("docs.md")]
diff --git a/core/core/src/services/alluxio/config.rs
b/core/services/alluxio/src/config.rs
similarity index 92%
rename from core/core/src/services/alluxio/config.rs
rename to core/services/alluxio/src/config.rs
index 429f65232..1a202f2fa 100644
--- a/core/core/src/services/alluxio/config.rs
+++ b/core/services/alluxio/src/config.rs
@@ -48,10 +48,10 @@ impl Debug for AlluxioConfig {
}
}
-impl crate::Configurator for AlluxioConfig {
+impl opendal_core::Configurator for AlluxioConfig {
type Builder = AlluxioBuilder;
- fn from_uri(uri: &crate::types::OperatorUri) -> crate::Result<Self> {
+ fn from_uri(uri: &opendal_core::OperatorUri) -> opendal_core::Result<Self>
{
let mut map = uri.options().clone();
if let Some(authority) = uri.authority() {
map.insert("endpoint".to_string(), format!("http://{authority}"));
@@ -74,8 +74,8 @@ impl crate::Configurator for AlluxioConfig {
#[cfg(test)]
mod tests {
use super::*;
- use crate::Configurator;
- use crate::types::OperatorUri;
+ use opendal_core::Configurator;
+ use opendal_core::OperatorUri;
#[test]
fn from_uri_sets_endpoint_and_root() {
diff --git a/core/core/src/services/alluxio/core.rs
b/core/services/alluxio/src/core.rs
similarity index 99%
rename from core/core/src/services/alluxio/core.rs
rename to core/services/alluxio/src/core.rs
index 558448385..28c8080ad 100644
--- a/core/core/src/services/alluxio/core.rs
+++ b/core/services/alluxio/src/core.rs
@@ -26,8 +26,8 @@ use serde::Deserialize;
use serde::Serialize;
use super::error::parse_error;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// Alluxio core
#[derive(Clone)]
diff --git a/core/core/src/services/alluxio/deleter.rs
b/core/services/alluxio/src/deleter.rs
similarity index 96%
rename from core/core/src/services/alluxio/deleter.rs
rename to core/services/alluxio/src/deleter.rs
index 6ff6ccd4b..bf3655fb2 100644
--- a/core/core/src/services/alluxio/deleter.rs
+++ b/core/services/alluxio/src/deleter.rs
@@ -18,8 +18,8 @@
use std::sync::Arc;
use super::core::*;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub struct AlluxioDeleter {
core: Arc<AlluxioCore>,
diff --git a/core/core/src/services/alluxio/docs.md
b/core/services/alluxio/src/docs.md
similarity index 95%
rename from core/core/src/services/alluxio/docs.md
rename to core/services/alluxio/src/docs.md
index eaaa20fa5..3d12b94e7 100644
--- a/core/core/src/services/alluxio/docs.md
+++ b/core/services/alluxio/src/docs.md
@@ -25,7 +25,7 @@ You can refer to [`AlluxioBuilder`]'s docs for more
information
```rust,no_run
use anyhow::Result;
-use opendal_core::services::Alluxio;
+use opendal_service_alluxio::Alluxio;
use opendal_core::Operator;
#[tokio::main]
diff --git a/core/core/src/services/alluxio/error.rs
b/core/services/alluxio/src/error.rs
similarity index 98%
rename from core/core/src/services/alluxio/error.rs
rename to core/services/alluxio/src/error.rs
index 71935cee7..6b02ec538 100644
--- a/core/core/src/services/alluxio/error.rs
+++ b/core/services/alluxio/src/error.rs
@@ -19,8 +19,8 @@ use bytes::Buf;
use http::Response;
use serde::Deserialize;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
/// the error response of alluxio
#[derive(Default, Debug, Deserialize)]
diff --git a/core/core/src/services/alluxio/mod.rs
b/core/services/alluxio/src/lib.rs
similarity index 96%
rename from core/core/src/services/alluxio/mod.rs
rename to core/services/alluxio/src/lib.rs
index 8b420ee98..29908c174 100644
--- a/core/core/src/services/alluxio/mod.rs
+++ b/core/services/alluxio/src/lib.rs
@@ -18,7 +18,7 @@
/// Default scheme for alluxio service.
pub const ALLUXIO_SCHEME: &str = "alluxio";
-use crate::types::DEFAULT_OPERATOR_REGISTRY;
+use opendal_core::DEFAULT_OPERATOR_REGISTRY;
mod backend;
mod config;
diff --git a/core/core/src/services/alluxio/lister.rs
b/core/services/alluxio/src/lister.rs
similarity index 94%
rename from core/core/src/services/alluxio/lister.rs
rename to core/services/alluxio/src/lister.rs
index 5582a59a6..874467b36 100644
--- a/core/core/src/services/alluxio/lister.rs
+++ b/core/services/alluxio/src/lister.rs
@@ -18,10 +18,10 @@
use std::sync::Arc;
use super::core::AlluxioCore;
-use crate::ErrorKind;
-use crate::Result;
-use crate::raw::oio::Entry;
-use crate::raw::*;
+use opendal_core::ErrorKind;
+use opendal_core::Result;
+use opendal_core::raw::oio::Entry;
+use opendal_core::raw::*;
pub struct AlluxioLister {
core: Arc<AlluxioCore>,
diff --git a/core/core/src/services/alluxio/writer.rs
b/core/services/alluxio/src/writer.rs
similarity index 97%
rename from core/core/src/services/alluxio/writer.rs
rename to core/services/alluxio/src/writer.rs
index 75ed24d6d..e889b673c 100644
--- a/core/core/src/services/alluxio/writer.rs
+++ b/core/services/alluxio/src/writer.rs
@@ -18,8 +18,8 @@
use std::sync::Arc;
use super::core::AlluxioCore;
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::*;
+use opendal_core::*;
pub type AlluxioWriters = AlluxioWriter;
diff --git a/core/src/lib.rs b/core/src/lib.rs
index f1d666ead..710110424 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -29,6 +29,8 @@ pub mod services {
pub use opendal_core::services::*;
#[cfg(feature = "services-aliyun-drive")]
pub use opendal_service_aliyun_drive::*;
+ #[cfg(feature = "services-alluxio")]
+ pub use opendal_service_alluxio::*;
#[cfg(feature = "services-azblob")]
pub use opendal_service_azblob::*;
#[cfg(feature = "services-azdls")]