You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2024/07/08 10:38:53 UTC

Re: [PR] feat(core): Add object versioning for OSS [opendal]

Xuanwo commented on code in PR #4870:
URL: https://github.com/apache/opendal/pull/4870#discussion_r1668391978


##########
core/src/raw/http_util/header.rs:
##########
@@ -186,6 +196,10 @@ pub fn parse_into_metadata(path: &str, headers: &HeaderMap) -> Result<Metadata>
         m.set_content_disposition(v);
     }
 
+    if let Some(v) = parse_version_id(headers)? {

Review Comment:
   Hi, please implement those logic in oss instead of `raw`.



##########
core/src/services/oss/core.rs:
##########
@@ -47,6 +47,8 @@ mod constants {
     pub const X_OSS_SERVER_SIDE_ENCRYPTION_KEY_ID: &str = "x-oss-server-side-encryption-key-id";
 
     pub const RESPONSE_CONTENT_DISPOSITION: &str = "response-content-disposition";
+
+    pub const OBJECT_VERSIONING: &str = "versionId";

Review Comment:
   How about using name `OSS_QUERY_VERSION_ID`?



##########
core/src/services/oss/backend.rs:
##########
@@ -440,10 +440,7 @@ impl Access for OssBackend {
     }
 
     async fn stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
-        let resp = self
-            .core
-            .oss_head_object(path, args.if_match(), args.if_none_match())
-            .await?;
+        let resp = self.core.oss_head_object(path, &args).await?;

Review Comment:
   Thanks a lot for this change.



##########
core/src/types/read/reader.rs:
##########
@@ -133,7 +133,7 @@ impl Reader {
                     let size = self
                         .ctx
                         .accessor()
-                        .stat(self.ctx.path(), OpStat::new())
+                        .stat(self.ctx.path(), get_stat_op_from_read_op(self.ctx.args()))

Review Comment:
   At current stage, only version is meaningful. How about just extract version? We can remove `get_stat_op_from_read_op`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org