Xuanwo commented on code in PR #2143:
URL:
https://github.com/apache/incubator-opendal/pull/2143#discussion_r1185687908
##########
core/src/services/gcs/backend.rs:
##########
@@ -119,6 +119,7 @@ pub struct GcsBuilder {
customed_token_loader: Option<Box<dyn GoogleTokenLoad>>,
predefined_acl: Option<String>,
default_storage_class: Option<String>,
+ write_buffer_size: Option<usize>,
Review Comment:
Please call this buffer: `write_fixed_size` which means the fixed size that
write used to flush into underlying storage.
##########
core/src/services/gcs/backend.rs:
##########
@@ -236,6 +237,13 @@ impl GcsBuilder {
};
self
}
+
+ /// set the buffer size of unsized write.
+ pub fn write_buffer_size(&mut self, buffer_size: &str) -> &mut Self {
Review Comment:
We should accept `usize` instead of parsing from `&str`.
##########
core/src/services/s3/backend.rs:
##########
@@ -304,6 +304,8 @@ pub struct S3Builder {
http_client: Option<HttpClient>,
customed_credential_load: Option<Box<dyn AwsCredentialLoad>>,
+
+ write_buffer_size: Option<usize>,
Review Comment:
Please call this value `write_min_size`.
##########
core/src/services/oss/backend.rs:
##########
@@ -123,6 +123,7 @@ pub struct OssBuilder {
access_key_secret: Option<String>,
http_client: Option<HttpClient>,
+ write_buffer_size: Option<usize>,
Review Comment:
Please call this value `write_min_size`.
##########
core/src/services/gcs/backend.rs:
##########
@@ -430,7 +439,7 @@ impl Accessor for GcsBackend {
async fn write(&self, path: &str, args: OpWrite) -> Result<(RpWrite,
Self::Writer)> {
Ok((
RpWrite::default(),
- GcsWriter::new(self.core.clone(), path, args),
+ GcsWriter::new(self.core.clone(), path, args,
self.core.writer_buffer_size),
Review Comment:
GcsWriter accept a `core` so we don't need to pass it in `GcsWriter::new`
##########
core/src/services/gcs/backend.rs:
##########
@@ -236,6 +237,13 @@ impl GcsBuilder {
};
self
}
+
+ /// set the buffer size of unsized write.
Review Comment:
Please add detailed comments for this config. What's it means, the
requirement (must be multiple of 256KiB), how it works..
--
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]