swamirishi commented on code in PR #8587:
URL: https://github.com/apache/ozone/pull/8587#discussion_r2411605464
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java:
##########
@@ -261,10 +285,40 @@ public void incrUsedBytes(long bytes) {
this.usedBytes += bytes;
}
+ public void decrUsedBytes(long bytes, boolean increasePendingDeleteBytes) {
+ this.usedBytes -= bytes;
+ if (increasePendingDeleteBytes) {
+ incrSnapshotUsedBytes(bytes);
+ }
+ }
Review Comment:
I felt it would be more error prone as one might forget to make the function
call while updating the bucket usage metrics.
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java:
##########
@@ -324,6 +378,8 @@ public Map<String, String> toAuditMap() {
auditMap.put(OzoneConsts.USED_BYTES, String.valueOf(this.usedBytes));
auditMap.put(OzoneConsts.USED_NAMESPACE,
String.valueOf(this.usedNamespace));
+ auditMap.put(OzoneConsts.PENDING_DELETE_SNAPSHOT_BYTES,
String.valueOf(this.snapshotUsedBytes));
+ auditMap.put(OzoneConsts.PENDING_DELETE_SNAPSHOT_NAMESPACE,
String.valueOf(this.snapshotUsedNamespace));
Review Comment:
done
--
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]