xichen01 commented on code in PR #4572:
URL: https://github.com/apache/ozone/pull/4572#discussion_r1194114709


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java:
##########
@@ -109,15 +189,18 @@ public long getCreationTime() {
   }
 
   public TreeMap<Integer, PartKeyInfo> getPartKeyInfoMap() {
-    return partKeyInfoList;
+    TreeMap<Integer, PartKeyInfo> treeMap = new TreeMap<>();
+    partKeyInfoMap.forEach(
+        partKeyInfo -> treeMap.put(partKeyInfo.getPartNumber(), partKeyInfo));

Review Comment:
   The whole multiupload process will only call `getPartKeyInfoMap` once even 
if a lot of key parts are uploaded, so this `TreeMap` doesn't consume a lot of 
memory, if we don't return `TreeMap`, we need to change a lot of existing code.
   
   
![image](https://github.com/apache/ozone/assets/32928346/517bab4c-fd19-477b-8a84-ba04a103a799)
   `getPartKeyInfoMap` will not call when `S3MultipartUploadCommitPartRequest`
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to