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 28b55fe7b feat(services/lakefs): Add operation in http context (#5809)
28b55fe7b is described below

commit 28b55fe7b7f1be88af254544a5d6882caebc5d45
Author: Guangdong Liu <[email protected]>
AuthorDate: Tue Mar 18 19:27:46 2025 +0800

    feat(services/lakefs): Add operation in http context (#5809)
    
    Add operation in http context
---
 core/src/services/lakefs/core.rs | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/core/src/services/lakefs/core.rs b/core/src/services/lakefs/core.rs
index b2ab57422..61aa5998a 100644
--- a/core/src/services/lakefs/core.rs
+++ b/core/src/services/lakefs/core.rs
@@ -67,7 +67,8 @@ impl LakefsCore {
 
         let auth_header_content = 
format_authorization_by_basic(&self.username, &self.password)?;
         req = req.header(header::AUTHORIZATION, auth_header_content);
-
+        // Inject operation to the request.
+        let req = req.extension(Operation::ReaderStart);
         let req = req.body(Buffer::new()).map_err(new_request_build_error)?;
 
         self.client.send(req).await
@@ -99,7 +100,8 @@ impl LakefsCore {
         if !range.is_full() {
             req = req.header(header::RANGE, range.to_header());
         }
-
+        // Inject operation to the request.
+        let req = req.extension(Operation::ReaderStart);
         let req = req.body(Buffer::new()).map_err(new_request_build_error)?;
 
         self.client.fetch(req).await
@@ -139,7 +141,8 @@ impl LakefsCore {
 
         let auth_header_content = 
format_authorization_by_basic(&self.username, &self.password)?;
         req = req.header(header::AUTHORIZATION, auth_header_content);
-
+        // Inject operation to the request.
+        let req = req.extension(Operation::ReaderStart);
         let req = req.body(Buffer::new()).map_err(new_request_build_error)?;
 
         self.client.send(req).await
@@ -167,7 +170,8 @@ impl LakefsCore {
 
         let auth_header_content = 
format_authorization_by_basic(&self.username, &self.password)?;
         req = req.header(header::AUTHORIZATION, auth_header_content);
-
+        // Inject operation to the request.
+        let req = req.extension(Operation::WriterWrite);
         let req = req.body(body).map_err(new_request_build_error)?;
 
         self.client.send(req).await
@@ -190,7 +194,8 @@ impl LakefsCore {
 
         let auth_header_content = 
format_authorization_by_basic(&self.username, &self.password)?;
         req = req.header(header::AUTHORIZATION, auth_header_content);
-
+        // Inject operation to the request.
+        let req = req.extension(Operation::DeleterFlush);
         let req = req.body(Buffer::new()).map_err(new_request_build_error)?;
 
         self.client.send(req).await
@@ -221,9 +226,10 @@ impl LakefsCore {
         map.insert("src_path", p);
 
         let req = req
+            // Inject operation to the request.
+            .extension(Operation::DeleterFlush)
             .body(serde_json::to_vec(&map).unwrap().into())
             .map_err(new_request_build_error)?;
-
         self.client.send(req).await
     }
 }

Reply via email to