This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 58a842d chore: use log over tracing (#96)
58a842d is described below
commit 58a842d4fc24d09d929ca787dc6b4b96344ef79a
Author: tison <[email protected]>
AuthorDate: Mon Dec 15 14:31:17 2025 +0800
chore: use log over tracing (#96)
Signed-off-by: tison <[email protected]>
---
crates/fluss/Cargo.toml | 11 +++++------
crates/fluss/src/client/write/broadcast.rs | 3 +--
crates/fluss/src/io/file_io.rs | 4 +---
crates/fluss/src/rpc/server_connection.rs | 11 ++++++-----
crates/fluss/src/util/mod.rs | 3 +--
5 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/crates/fluss/Cargo.toml b/crates/fluss/Cargo.toml
index 54235c4..aa763d5 100644
--- a/crates/fluss/Cargo.toml
+++ b/crates/fluss/Cargo.toml
@@ -37,24 +37,23 @@ futures = "0.3"
clap = { workspace = true }
crc32c = "0.6.8"
linked-hash-map = "0.5.6"
-prost = "0.13.5"
+prost = "0.14"
rand = "0.9.1"
serde = { version = "1.0.219", features = ["derive", "rc"] }
serde_json = "1.0.140"
-thiserror = "1.0"
-tracing = "0.1"
+thiserror = "2"
+log = { version = "0.4", features = ["kv_std"] }
tokio = { workspace = true }
parking_lot = "0.12"
bytes = "1.10.1"
dashmap = "6.1.0"
rust_decimal = "1"
-ordered-float = { version = "4", features = ["serde"] }
+ordered-float = { version = "5", features = ["serde"] }
parse-display = "0.10"
ref-cast = "1.0"
jiff = { workspace = true }
opendal = "0.55.0"
url = "2.5.7"
-async-trait = "0.1.89"
uuid = { version = "1.10", features = ["v4"] }
tempfile = "3.23.0"
@@ -67,4 +66,4 @@ test-env-helpers = "0.2.2"
[build-dependencies]
-prost-build = { version = "0.13.5" }
+prost-build = { version = "0.14" }
diff --git a/crates/fluss/src/client/write/broadcast.rs
b/crates/fluss/src/client/write/broadcast.rs
index 2dcc34c..d2e7f0c 100644
--- a/crates/fluss/src/client/write/broadcast.rs
+++ b/crates/fluss/src/client/write/broadcast.rs
@@ -19,7 +19,6 @@ use parking_lot::RwLock;
use std::sync::Arc;
use thiserror::Error;
use tokio::sync::Notify;
-use tracing::warn;
pub type Result<T, E = Error> = std::result::Result<T, E>;
@@ -111,7 +110,7 @@ where
fn drop(&mut self) {
let mut data = self.shared.data.write();
if data.is_none() {
- warn!("BroadcastOnce dropped without producing");
+ log::warn!("BroadcastOnce dropped without producing");
*data = Some(Err(Error::Dropped));
self.shared.notify.notify_waiters();
}
diff --git a/crates/fluss/src/io/file_io.rs b/crates/fluss/src/io/file_io.rs
index 96be06f..ec3b87e 100644
--- a/crates/fluss/src/io/file_io.rs
+++ b/crates/fluss/src/io/file_io.rs
@@ -97,12 +97,10 @@ impl FileIOBuilder {
}
}
-#[async_trait::async_trait]
pub trait FileRead: Send + Unpin + 'static {
- async fn read(&self, range: Range<u64>) -> Result<Bytes>;
+ fn read(&self, range: Range<u64>) -> impl Future<Output = Result<Bytes>> +
Send;
}
-#[async_trait::async_trait]
impl FileRead for opendal::Reader {
async fn read(&self, range: Range<u64>) -> Result<Bytes> {
Ok(opendal::Reader::read(self, range).await?.to_bytes())
diff --git a/crates/fluss/src/rpc/server_connection.rs
b/crates/fluss/src/rpc/server_connection.rs
index 4eeda46..c474534 100644
--- a/crates/fluss/src/rpc/server_connection.rs
+++ b/crates/fluss/src/rpc/server_connection.rs
@@ -37,7 +37,6 @@ use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt,
BufStream, WriteHalf};
use tokio::sync::Mutex as AsyncMutex;
use tokio::sync::oneshot::{Sender, channel};
use tokio::task::JoinHandle;
-use tracing::warn;
pub type MessengerTransport = ServerConnectionInner<BufStream<Transport>>;
@@ -178,8 +177,10 @@ where
let header =
match ResponseHeader::read_versioned(&mut cursor,
ApiVersion(0)) {
Ok(header) => header,
- Err(e) => {
- warn!(%e, "Cannot read message header,
ignoring message");
+ Err(err) => {
+ log::warn!(
+ "Cannot read message header, ignoring
message: {err:?}"
+ );
continue;
}
};
@@ -189,8 +190,8 @@ where
match map.remove(&header.request_id) {
Some(active_request) => active_request,
_ => {
- warn!(
- request_id = header.request_id,
+ log::warn!(
+ request_id:% = header.request_id;
"Got response for unknown request",
);
continue;
diff --git a/crates/fluss/src/util/mod.rs b/crates/fluss/src/util/mod.rs
index f93abf9..d8c0db5 100644
--- a/crates/fluss/src/util/mod.rs
+++ b/crates/fluss/src/util/mod.rs
@@ -22,7 +22,6 @@ use std::hash::Hash;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};
-use tracing::warn;
pub fn current_time_ms() -> i64 {
SystemTime::now()
@@ -34,7 +33,7 @@ pub fn current_time_ms() -> i64 {
pub async fn delete_file(file_path: PathBuf) {
tokio::fs::remove_file(&file_path)
.await
- .unwrap_or_else(|e| warn!("Could not delete file: {:?}, error: {:?}",
&file_path, e));
+ .unwrap_or_else(|err| log::warn!("Could not delete file:
{file_path:?}, error: {err:?}"));
}
pub struct FairBucketStatusMap<S> {