juncevich commented on code in PR #7558:
URL: https://github.com/apache/ozone/pull/7558#discussion_r1907899980


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -509,6 +509,33 @@ private OmKeyInfo readKeyInfo(OmKeyArgs args, BucketLayout 
bucketLayout)
     if (args.getLatestVersionLocation()) {
       slimLocationVersion(value);
     }
+    int partNumberParam = args.getMultipartUploadPartNumber();
+    if (partNumberParam > 0) {
+      OmKeyLocationInfoGroup latestLocationVersion = 
value.getLatestVersionLocations();
+      if (latestLocationVersion != null && 
latestLocationVersion.isMultipartKey()) {
+        List<OmKeyLocationInfo> currentLocations =
+            
value.getKeyLocationVersions().get(value.getKeyLocationVersions().size() - 1)
+                .getLocationList()
+                .stream()
+                .filter(it -> it.getPartNumber() == partNumberParam)
+                .collect(Collectors.toList());
+
+        value.setKeyLocationVersions(
+            Collections.singletonList(
+                new OmKeyLocationInfoGroup(
+                    latestLocationVersion.getVersion(),
+                    currentLocations,
+                    true
+                )
+            )
+        );
+
+        long dataLength = currentLocations.stream()
+            .mapToLong(BlockLocationInfo::getLength)
+            .sum();
+        value.setDataSize(dataLength);

Review Comment:
   If I right understand you were saying about this method 
   org.apache.hadoop.ozone.client.rpc.RpcClient#getOzoneKeyDetails
   
   I think there are different cases. We have different methods response 
building processes. We don't have a constructor with  keyLocationVersions 
setting. We have a builder, which accepts List<OmKeyLocationInfoGroup> as 
KeyLocationVersions.
   
   Can you get more information in case I misunderstood you?



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