jojochuang commented on code in PR #8655:
URL: https://github.com/apache/ozone/pull/8655#discussion_r2244536134
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########
@@ -381,14 +418,25 @@ private void processDeletedKeysForStore(SnapshotInfo
currentSnapshotInfo, KeyMan
// Validating if the previous snapshot is still the same before
purging the blocks.
SnapshotUtils.validatePreviousSnapshotId(currentSnapshotInfo,
snapshotChainManager,
expectedPreviousSnapshotId);
- Pair<Integer, Boolean> purgeResult =
processKeyDeletes(keyBlocksList, pendingKeysDeletion.getKeysToModify(),
- renamedTableEntries, snapshotTableKey,
expectedPreviousSnapshotId);
- remainNum -= purgeResult.getKey();
+ Pair<Pair<Integer, Long>, Boolean> purgeResult =
processKeyDeletes(keyBlocksList,
+ pendingKeysDeletion.getKeysToModify(), renamedTableEntries,
snapshotTableKey,
+ expectedPreviousSnapshotId,
pendingKeysDeletion.getKeyBlockReplicatedSize());
+ remainNum -= purgeResult.getKey().getKey();
successStatus = purgeResult.getValue();
getMetrics().incrNumKeysProcessed(keyBlocksList.size());
- getMetrics().incrNumKeysSentForPurge(purgeResult.getKey());
+
getMetrics().incrNumKeysSentForPurge(purgeResult.getKey().getKey());
+
+ if (currentSnapshotInfo == null) {
+
aosDeletionStats.updateDeletionStats(purgeResult.getKey().getKey(),
purgeResult.getKey().getValue(),
+ keyBlocksList.size() +
pendingKeysDeletion.getNotReclaimableKeyCount(),
+ pendingKeysDeletion.getNotReclaimableKeyCount());
+ } else {
+
snapshotDeletionStats.updateDeletionStats(purgeResult.getKey().getKey(),
purgeResult.getKey().getValue(),
+ keyBlocksList.size() +
pendingKeysDeletion.getNotReclaimableKeyCount(),
+ pendingKeysDeletion.getNotReclaimableKeyCount());
Review Comment:
it seems these two cases are almost exactly the same except the object
itself is aosDeletionStats or snapshotDeletionStats. A refactoring is
recommended though not required.
--
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]