Xuanwo commented on code in PR #1801:
URL: 
https://github.com/apache/incubator-opendal/pull/1801#discussion_r1152802816


##########
core/src/services/gcs/backend.rs:
##########
@@ -625,6 +641,85 @@ impl GcsBackend {
 
         self.client.send_async(req).await
     }
+
+    async fn gcs_initiate_multipart_upload(
+        &self,
+        path: &str,
+    ) -> Result<Response<IncomingAsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!("{}/{}/{}?uploads", self.endpoint, self.bucket, p);
+        let mut req = Request::post(&url)
+            .body(AsyncBody::Empty)
+            .map_err(new_request_build_error)?;
+        self.signer.sign(&mut req).map_err(new_request_sign_error)?;
+        self.client.send_async(req).await
+    }
+
+    pub fn gcs_upload_part_request(
+        &self,
+        path: &str,
+        upload_id: &str,
+        part_number: usize,
+        size: Option<u64>,
+        body: AsyncBody,
+    ) -> Result<Request<AsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!(
+            "{}/{}/{}?partNumber={}&uploadId={}",

Review Comment:
   The `gcs` services are designed to utilize the native JSON API instead of 
the S3 compatible API. While it is possible to use S3's multi-platform API 
directly, it should be noted that users can use the `s3` service already.



##########
core/src/services/gcs/backend.rs:
##########
@@ -625,6 +641,85 @@ impl GcsBackend {
 
         self.client.send_async(req).await
     }
+
+    async fn gcs_initiate_multipart_upload(
+        &self,
+        path: &str,
+    ) -> Result<Response<IncomingAsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!("{}/{}/{}?uploads", self.endpoint, self.bucket, p);
+        let mut req = Request::post(&url)
+            .body(AsyncBody::Empty)
+            .map_err(new_request_build_error)?;
+        self.signer.sign(&mut req).map_err(new_request_sign_error)?;
+        self.client.send_async(req).await
+    }
+
+    pub fn gcs_upload_part_request(
+        &self,
+        path: &str,
+        upload_id: &str,
+        part_number: usize,
+        size: Option<u64>,
+        body: AsyncBody,
+    ) -> Result<Request<AsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!(
+            "{}/{}/{}?partNumber={}&uploadId={}",

Review Comment:
   The `gcs` services are designed to utilize the native JSON API instead of 
the S3 compatible API. While it is possible to use S3's multipart API directly, 
it should be noted that users can use the `s3` service already.



-- 
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