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


##########
core/src/services/azblob/core.rs:
##########
@@ -415,17 +386,14 @@ impl AzblobCore {
     ) -> Result<Request<Buffer>> {
         // To be written as part of a blob, a block must have been 
successfully written to the server in an earlier Put Block operation.
         // refer to 
https://learn.microsoft.com/en-us/rest/api/storageservices/put-block?tabs=microsoft-entra-id
-        let p = build_abs_path(&self.root, path);
+        let url = QueryPairsWriter::new(&self.build_path_url(path))
+            .push("comp", "block")
+            .push(
+                "blocked",

Review Comment:
   This should be `blockid`.



##########
core/src/services/azblob/core.rs:
##########
@@ -171,34 +171,28 @@ impl AzblobCore {
 }
 
 impl AzblobCore {
+    fn build_path_url(&self, path: &str) -> String {
+        format!(
+            "{}/{}/{}",
+            self.endpoint,
+            self.container,
+            percent_encode_path(&build_abs_path(&self.root, path))
+        )
+    }
+
     pub fn azblob_get_blob_request(
         &self,
         path: &str,
         range: BytesRange,
         args: &OpRead,
     ) -> Result<Request<Buffer>> {
-        let p = build_abs_path(&self.root, path);
+        let mut url = QueryPairsWriter::new(&self.build_path_url(path));

Review Comment:
   QueryPairsWriter is optimized for large URIs, so applying it to all URLs 
doesn't seem like a good idea to me.



##########
core/src/services/azblob/core.rs:
##########
@@ -171,34 +171,28 @@ impl AzblobCore {
 }
 
 impl AzblobCore {
+    fn build_path_url(&self, path: &str) -> String {

Review Comment:
   Nice change!



##########
core/src/services/azblob/core.rs:
##########
@@ -466,13 +434,9 @@ impl AzblobCore {
         block_ids: Vec<Uuid>,
         args: &OpWrite,
     ) -> Result<Request<Buffer>> {
-        let p = build_abs_path(&self.root, path);
-        let url = format!(
-            "{}/{}/{}?comp=blocklist",
-            self.endpoint,
-            self.container,
-            percent_encode_path(&p),
-        );
+        let url = QueryPairsWriter::new(&self.build_path_url(path))

Review Comment:
   Maybe it doesn't worth to adopt `QueryPairsWriter`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to