This is an automated email from the ASF dual-hosted git repository.
chungen0126 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new a552e060433 HDDS-16183. Avoid the per-group list copy in
OMKeyRequest.sumBlockLengths (#11026)
a552e060433 is described below
commit a552e060433082fe524ed07067e027c2795ba142
Author: Chi-Hsuan Huang <[email protected]>
AuthorDate: Mon Aug 17 18:34:13 2026 +0800
HDDS-16183. Avoid the per-group list copy in OMKeyRequest.sumBlockLengths
(#11026)
---
.../java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
index 9ca87d509d5..ff65b97d0af 100644
---
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
+++
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
@@ -933,9 +933,11 @@ protected boolean checkDirectoryAlreadyExists(String
volumeName,
public static long sumBlockLengths(OmKeyInfo omKeyInfo) {
long bytesUsed = 0;
for (OmKeyLocationInfoGroup group: omKeyInfo.getKeyLocationVersions()) {
- for (OmKeyLocationInfo locationInfo : group.getLocationList()) {
- bytesUsed += QuotaUtil.getReplicatedSize(
- locationInfo.getLength(), omKeyInfo.getReplicationConfig());
+ for (List<OmKeyLocationInfo> locationInfoList :
group.getLocationLists()) {
+ for (OmKeyLocationInfo locationInfo : locationInfoList) {
+ bytesUsed += QuotaUtil.getReplicatedSize(
+ locationInfo.getLength(), omKeyInfo.getReplicationConfig());
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]