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/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 22eda0f3 feat: Add missing functions for trace layers (#2025)
22eda0f3 is described below

commit 22eda0f3614aafca29c2c59cf4e3433ca4059a1f
Author: teckick <[email protected]>
AuthorDate: Tue Apr 18 00:52:36 2023 +0800

    feat: Add missing functions for trace layers (#2025)
    
    add missing functions for trace
---
 core/src/layers/minitrace.rs | 20 ++++++++++++++++++++
 core/src/layers/tracing.rs   | 20 ++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/core/src/layers/minitrace.rs b/core/src/layers/minitrace.rs
index fd977e96..3759fb19 100644
--- a/core/src/layers/minitrace.rs
+++ b/core/src/layers/minitrace.rs
@@ -166,6 +166,16 @@ impl<A: Accessor> LayeredAccessor for MinitraceAccessor<A> 
{
             .await
     }
 
+    #[trace("copy", enter_on_poll = true)]
+    async fn copy(&self, from: &str, to: &str, args: OpCopy) -> Result<RpCopy> 
{
+        self.inner().copy(from, to, args).await
+    }
+
+    #[trace("rename", enter_on_poll = true)]
+    async fn rename(&self, from: &str, to: &str, args: OpRename) -> 
Result<RpRename> {
+        self.inner().rename(from, to, args).await
+    }
+
     #[trace("stat", enter_on_poll = true)]
     async fn stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
         self.inner.stat(path, args).await
@@ -227,6 +237,16 @@ impl<A: Accessor> LayeredAccessor for MinitraceAccessor<A> 
{
         })
     }
 
+    #[trace("blocking_copy")]
+    fn blocking_copy(&self, from: &str, to: &str, args: OpCopy) -> 
Result<RpCopy> {
+        self.inner().blocking_copy(from, to, args)
+    }
+
+    #[trace("blocking_rename")]
+    fn blocking_rename(&self, from: &str, to: &str, args: OpRename) -> 
Result<RpRename> {
+        self.inner().blocking_rename(from, to, args)
+    }
+
     #[trace("blocking_stat")]
     fn blocking_stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
         self.inner.blocking_stat(path, args)
diff --git a/core/src/layers/tracing.rs b/core/src/layers/tracing.rs
index c210290e..8f9b8a5d 100644
--- a/core/src/layers/tracing.rs
+++ b/core/src/layers/tracing.rs
@@ -171,6 +171,16 @@ impl<A: Accessor> LayeredAccessor for TracingAccessor<A> {
             .map(|(rp, r)| (rp, TracingWrapper::new(Span::current(), r)))
     }
 
+    #[tracing::instrument(level = "debug", skip(self))]
+    async fn copy(&self, from: &str, to: &str, args: OpCopy) -> Result<RpCopy> 
{
+        self.inner().copy(from, to, args).await
+    }
+
+    #[tracing::instrument(level = "debug", skip(self))]
+    async fn rename(&self, from: &str, to: &str, args: OpRename) -> 
Result<RpRename> {
+        self.inner().rename(from, to, args).await
+    }
+
     #[tracing::instrument(level = "debug", skip(self))]
     async fn stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
         self.inner.stat(path, args).await
@@ -226,6 +236,16 @@ impl<A: Accessor> LayeredAccessor for TracingAccessor<A> {
             .map(|(rp, r)| (rp, TracingWrapper::new(Span::current(), r)))
     }
 
+    #[tracing::instrument(level = "debug", skip(self))]
+    fn blocking_copy(&self, from: &str, to: &str, args: OpCopy) -> 
Result<RpCopy> {
+        self.inner().blocking_copy(from, to, args)
+    }
+
+    #[tracing::instrument(level = "debug", skip(self))]
+    fn blocking_rename(&self, from: &str, to: &str, args: OpRename) -> 
Result<RpRename> {
+        self.inner().blocking_rename(from, to, args)
+    }
+
     #[tracing::instrument(level = "debug", skip(self))]
     fn blocking_stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
         self.inner.blocking_stat(path, args)

Reply via email to