You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/04/24 05:13:23 UTC

(opendal) branch main updated: feat(services/compfs): init compfs (#4519)

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 1130fab102 feat(services/compfs): init compfs (#4519)
1130fab102 is described below

commit 1130fab1025a826a66f34ea1beddae5c555ba52e
Author: Pop <gm...@miao.dev>
AuthorDate: Wed Apr 24 14:13:18 2024 +0900

    feat(services/compfs): init compfs (#4519)
    
    * feat: init compfs
    
    * docs: add license header
---
 core/Cargo.lock                 | 181 +++++++++++++++++++++++++++++++++++++---
 core/Cargo.toml                 |   3 +
 core/src/services/compfs/mod.rs |  16 ++++
 core/src/services/mod.rs        |   3 +
 4 files changed, 193 insertions(+), 10 deletions(-)

diff --git a/core/Cargo.lock b/core/Cargo.lock
index 4159c45d7c..0746bbb377 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -70,6 +70,15 @@ dependencies = [
  "memchr",
 ]
 
+[[package]]
+name = "aligned-array"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e05c92d086290f52938013f6242ac62bf7d401fab8ad36798a609faa65c3fd2c"
+dependencies = [
+ "generic-array",
+]
+
 [[package]]
 name = "allocator-api2"
 version = "0.2.16"
@@ -1634,6 +1643,131 @@ dependencies = [
  "tokio-util",
 ]
 
+[[package]]
+name = "compio"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a00b7c4c000844a6e0f3b5b087ac54ee28e0a534049446f1005d5dd4d7d4d26b"
+dependencies = [
+ "compio-buf",
+ "compio-driver",
+ "compio-fs",
+ "compio-io",
+ "compio-log",
+ "compio-net",
+ "compio-runtime",
+]
+
+[[package]]
+name = "compio-buf"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "293f2dd31faab05551153ad8b8ca05bd33c6c04d6ee1d08decd4e9eeb63d1205"
+dependencies = [
+ "arrayvec",
+ "libc",
+]
+
+[[package]]
+name = "compio-driver"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66bd9ecab2e379fe2f2aacca212f804021b2ccda9195326732d33b3c6d503d74"
+dependencies = [
+ "aligned-array",
+ "cfg-if",
+ "compio-buf",
+ "compio-log",
+ "crossbeam-channel",
+ "crossbeam-queue",
+ "io-uring",
+ "libc",
+ "once_cell",
+ "os_pipe",
+ "paste",
+ "polling 3.3.2",
+ "slab",
+ "socket2 0.5.6",
+ "widestring",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "compio-fs"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98b989595ce84377161295546d063c83422a57f33d5f32553902bae28eb05e7f"
+dependencies = [
+ "cfg-if",
+ "compio-buf",
+ "compio-driver",
+ "compio-io",
+ "compio-runtime",
+ "libc",
+ "os_pipe",
+ "widestring",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "compio-io"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04cb9ca2b04d614c11c519ca2f00b3865c02ee1e40258f90c723d58eda418c45"
+dependencies = [
+ "compio-buf",
+ "futures-util",
+ "paste",
+]
+
+[[package]]
+name = "compio-log"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc4e560213c1996b618da369b7c9109564b41af9033802ae534465c4ee4e132f"
+dependencies = [
+ "tracing",
+]
+
+[[package]]
+name = "compio-net"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de53af8b59f0a835b7adb538b7b9f73e44200af6fbaebf482efaeca7d744f100"
+dependencies = [
+ "cfg-if",
+ "compio-buf",
+ "compio-driver",
+ "compio-io",
+ "compio-runtime",
+ "either",
+ "libc",
+ "socket2 0.5.6",
+ "widestring",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "compio-runtime"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f465f8e4c1fe782796733ff4cfc20d4f7f893135fe8a2997a97dccb58f30026"
+dependencies = [
+ "async-task",
+ "cfg-if",
+ "compio-buf",
+ "compio-driver",
+ "compio-log",
+ "crossbeam-queue",
+ "futures-util",
+ "libc",
+ "once_cell",
+ "os_pipe",
+ "smallvec",
+ "socket2 0.5.6",
+ "windows-sys 0.52.0",
+]
+
 [[package]]
 name = "concurrent-queue"
 version = "2.4.0"
@@ -3108,7 +3242,7 @@ dependencies = [
  "prost 0.11.9",
  "prost-types 0.11.9",
  "roxmltree",
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "thiserror",
  "tokio",
  "url",
@@ -3303,7 +3437,7 @@ dependencies = [
  "httpdate",
  "itoa",
  "pin-project-lite",
- "socket2 0.5.5",
+ "socket2 0.4.10",
  "tokio",
  "tower-service",
  "tracing",
@@ -3387,7 +3521,7 @@ dependencies = [
  "http-body 1.0.0",
  "hyper 1.2.0",
  "pin-project-lite",
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "tokio",
  "tower",
  "tower-service",
@@ -3502,13 +3636,23 @@ dependencies = [
  "windows-sys 0.48.0",
 ]
 
+[[package]]
+name = "io-uring"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "595a0399f411a508feb2ec1e970a4a30c249351e30208960d58298de8660b0e5"
+dependencies = [
+ "bitflags 1.3.2",
+ "libc",
+]
+
 [[package]]
 name = "ipconfig"
 version = "0.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
 dependencies = [
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "widestring",
  "windows-sys 0.48.0",
  "winreg 0.50.0",
@@ -4289,7 +4433,7 @@ dependencies = [
  "rustls-pemfile 1.0.4",
  "serde",
  "serde_json",
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "thiserror",
  "tokio",
  "tokio-rustls 0.24.1",
@@ -4572,6 +4716,7 @@ dependencies = [
  "bytes",
  "cacache",
  "chrono",
+ "compio",
  "criterion",
  "dashmap",
  "dotenvy",
@@ -4838,6 +4983,16 @@ dependencies = [
  "hashbrown 0.14.3",
 ]
 
+[[package]]
+name = "os_pipe"
+version = "1.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
 [[package]]
 name = "outref"
 version = "0.5.1"
@@ -4932,6 +5087,12 @@ dependencies = [
  "subtle",
 ]
 
+[[package]]
+name = "paste"
+version = "1.0.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
+
 [[package]]
 name = "path-clean"
 version = "1.0.1"
@@ -6968,12 +7129,12 @@ dependencies = [
 
 [[package]]
 name = "socket2"
-version = "0.5.5"
+version = "0.5.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
+checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
 dependencies = [
  "libc",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -7560,7 +7721,7 @@ dependencies = [
  "parking_lot 0.12.1",
  "pin-project-lite",
  "signal-hook-registry",
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "tokio-macros",
  "windows-sys 0.48.0",
 ]
@@ -7636,7 +7797,7 @@ dependencies = [
  "postgres-protocol",
  "postgres-types",
  "rand 0.8.5",
- "socket2 0.5.5",
+ "socket2 0.5.6",
  "tokio",
  "tokio-util",
  "whoami",
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 65f3900bdb..d16c808ec7 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -113,6 +113,7 @@ services-b2 = []
 services-cacache = ["dep:cacache"]
 services-chainsafe = []
 services-cloudflare-kv = []
+services-compfs = ["dep:compio"]
 services-cos = [
   "dep:reqsign",
   "reqsign?/services-tencent",
@@ -323,6 +324,8 @@ tikv-client = { version = "0.3.0", optional = true, default-features = false }
 hdfs-native = { version = "0.6.0", optional = true }
 # for services-surrealdb
 surrealdb = { version = "1.3.0", optional = true, features = ["protocol-http"] }
+# for services-compfs
+compio = { version = "0.9.0", optional = true, features = ["runtime"] }
 
 # Layers
 # for layers-async-backtrace
diff --git a/core/src/services/compfs/mod.rs b/core/src/services/compfs/mod.rs
new file mode 100644
index 0000000000..b248758bc1
--- /dev/null
+++ b/core/src/services/compfs/mod.rs
@@ -0,0 +1,16 @@
+// 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.
diff --git a/core/src/services/mod.rs b/core/src/services/mod.rs
index 62acbb0cc6..67f01ca94e 100644
--- a/core/src/services/mod.rs
+++ b/core/src/services/mod.rs
@@ -406,3 +406,6 @@ mod surrealdb;
 pub use surrealdb::Surrealdb;
 #[cfg(feature = "services-surrealdb")]
 pub use surrealdb::SurrealdbConfig;
+
+#[cfg(feature = "services-compfs")]
+mod compfs;