tanvipenumudy commented on code in PR #5565:
URL: https://github.com/apache/ozone/pull/5565#discussion_r1396746375
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -1702,7 +1687,19 @@ public OzoneKeyDetails getS3KeyDetails(String
bucketName, String keyName,
partNumber)
.collect(Collectors.toList());
keyInfo.updateLocationInfoList(filteredKeyLocationInfo, false);
- return getOzoneKeyDetails(keyInfo, true);
+ keyInfo.setDataSize(getTotalBytesRead(keyInfo));
+ return getOzoneKeyDetails(keyInfo);
+ }
+
+ private long getTotalBytesRead(OmKeyInfo keyInfo) throws IOException {
+ OzoneInputStream keyContent = getInputStreamWithRetryFunction(keyInfo);
+ byte[] buffer = new byte[4096];
+ int bytesRead;
+ long totalBytesRead = 0;
+ while ((bytesRead = keyContent.read(buffer)) != -1) {
+ totalBytesRead += bytesRead;
+ }
+ return totalBytesRead;
Review Comment:
As discussed offline with @kerneltime, I think we can have the block lengths
summed up for a given `partNumber` instead - I will update the changes
accordingly, thanks!
--
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]