Xuanwo commented on code in PR #2143:
URL:
https://github.com/apache/incubator-opendal/pull/2143#discussion_r1186713238
##########
core/src/services/gcs/backend.rs:
##########
@@ -236,6 +239,23 @@ impl GcsBuilder {
};
self
}
+
+ /// The buffer size should be a multiple of 256 KiB (256 x 1024 bytes),
unless it's the last chunk that completes the upload.
+ /// Larger chunk sizes typically make uploads faster, but note that
there's a tradeoff between speed and memory usage.
+ /// It's recommended that you use at least 8 MiB for the chunk size.
+ /// Reference: [Perform resumable
uploads](https://cloud.google.com/storage/docs/performing-resumable-uploads)
+ pub fn write_fixed_size(&mut self, fixed_buffer_size: usize) ->
Result<&mut Self> {
+ if fixed_buffer_size.checked_rem_euclid(256 * 1024).is_none() {
+ self.write_fixed_size = Some(fixed_buffer_size);
+ } else {
+ return Err(
+ Error::new(ErrorKind::ConfigInvalid, "The buffer size is
misconfigured")
Review Comment:
Yes!
--
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]