priyeshkaratha commented on code in PR #11685:
URL: https://github.com/apache/ozone/pull/11685#discussion_r4421030502
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ReconGlobalMetricsService.java:
##########
@@ -102,6 +102,18 @@ public Map<String, Long> getOpenKeySummary() {
return keysSummary;
}
+ /**
+ * Returns {@link #getOpenKeySummary()} with the committed part sizes of
incomplete multipart uploads added.
+ * The count is unchanged because each incomplete upload is already counted
once through its multipart open key.
+ */
+ public Map<String, Long> getOpenKeySummaryWithMPU() {
+ Map<String, Long> keysSummary = getOpenKeySummary();
+ Map<String, Long> mpuSummary = getMPUKeySummary();
+ keysSummary.merge("totalReplicatedDataSize",
mpuSummary.get("totalReplicatedDataSize"), Long::sum);
Review Comment:
Only /keys/open/summary uses getOpenKeySummaryWithMPU. Other callers of
getOpenKeySummary(), such as the cluster-state and overview pages, still leave
out multipart part sizes. Users would see different open-key totals depending
on the page.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/MultipartInfoInsightHandler.java:
##########
@@ -332,6 +337,26 @@ private void applyPartSize(OmMultipartPartKey partKey,
OmMultipartPartInfo partI
"replicated");
}
+ /**
+ * Returns the (unreplicated, replicated) size of the committed parts of a
single MPU, read from the embedded
+ * parts for legacy-schema MPUs and from {@code multipartPartsTable} for
split-schema MPUs.
+ */
+ public static Pair<Long, Long> getCommittedPartsSize(OmMultipartKeyInfo
multipartKeyInfo,
Review Comment:
This method re-implements what applyLegacyPartSizes and applyPartSize do,
and its replicated-size logic differs (OMMultipartUploadUtils.getReplicatedSize
versus QuotaUtil per part). It's easy for the two to drift apart, for example
in how EC padding is handled. One shared helper would fix this.
--
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]