benroeder commented on code in PR #7212:
URL: https://github.com/apache/opendal/pull/7212#discussion_r2838747631
##########
core/services/swift/src/writer.rs:
##########
@@ -28,11 +31,19 @@ pub struct SwiftWriter {
core: Arc<SwiftCore>,
op: OpWrite,
path: String,
+ /// Tracks the size of each uploaded segment by part number.
+ /// Populated by write_part(), consumed by complete_part().
+ part_sizes: Arc<Mutex<HashMap<usize, u64>>>,
}
impl SwiftWriter {
pub fn new(core: Arc<SwiftCore>, op: OpWrite, path: String) -> Self {
- SwiftWriter { core, op, path }
+ SwiftWriter {
+ core,
+ op,
+ path,
+ part_sizes: Arc::new(Mutex::new(HashMap::new())),
Review Comment:
Agree, that's cleaner. I'll add `size: Option<u64>` to `oio::MultipartPart`
and remove the `HashMap<usize, u64>` + `Mutex` from the writer.
--
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]