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 2025/03/20 15:05:14 UTC
(opendal) branch refactor-postion-write created (now 79c6cec36)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a change to branch refactor-postion-write
in repository https://gitbox.apache.org/repos/asf/opendal.git
at 79c6cec36 refactor(core): Migrate PositionWrite Executor to context based
This branch includes the following new commits:
new 79c6cec36 refactor(core): Migrate PositionWrite Executor to context based
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(opendal) 01/01: refactor(core): Migrate PositionWrite Executor to context based
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch refactor-postion-write
in repository https://gitbox.apache.org/repos/asf/opendal.git
commit 79c6cec36ad90bc973b465c91e087f222d393811
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Mar 20 23:04:45 2025 +0800
refactor(core): Migrate PositionWrite Executor to context based
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
core/src/raw/oio/write/position_write.rs | 6 +++---
core/src/services/fs/backend.rs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/src/raw/oio/write/position_write.rs b/core/src/raw/oio/write/position_write.rs
index f86aeb588..6aed255ad 100644
--- a/core/src/raw/oio/write/position_write.rs
+++ b/core/src/raw/oio/write/position_write.rs
@@ -79,8 +79,8 @@ pub struct PositionWriter<W: PositionWrite> {
#[allow(dead_code)]
impl<W: PositionWrite> PositionWriter<W> {
/// Create a new PositionWriter.
- pub fn new(inner: W, executor: Option<Executor>, concurrent: usize) -> Self {
- let executor = executor.unwrap_or_default();
+ pub fn new(info: Arc<AccessorInfo>, inner: W, concurrent: usize) -> Self {
+ let executor = info.executor();
Self {
w: Arc::new(inner),
@@ -240,7 +240,7 @@ mod tests {
async fn test_position_writer_with_concurrent_errors() {
let mut rng = thread_rng();
- let mut w = PositionWriter::new(TestWrite::new(), Some(Executor::new()), 200);
+ let mut w = PositionWriter::new(Arc::default(), TestWrite::new(), 200);
let mut total_size = 0u64;
for _ in 0..1000 {
diff --git a/core/src/services/fs/backend.rs b/core/src/services/fs/backend.rs
index 31fa48542..c41c9fe77 100644
--- a/core/src/services/fs/backend.rs
+++ b/core/src/services/fs/backend.rs
@@ -345,8 +345,8 @@ impl Access for FsBackend {
FsWriters::One(w)
} else {
FsWriters::Two(oio::PositionWriter::new(
+ self.info().clone(),
w,
- op.executor().cloned(),
op.concurrent(),
))
};