sadanand48 commented on code in PR #7365:
URL: https://github.com/apache/ozone/pull/7365#discussion_r1906564706
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/AbstractKeyDeletingService.java:
##########
@@ -411,20 +416,19 @@ public long optimizeDirDeletesAndSubmitRequest(long
remainNum,
int subdirDelNum = 0;
int subDirRecursiveCnt = 0;
int consumedSize = 0;
- while (remainNum > 0 && subDirRecursiveCnt < allSubDirList.size()) {
+ while (subDirRecursiveCnt < allSubDirList.size() && remainingBufLimit > 0)
{
try {
Pair<String, OmKeyInfo> stringOmKeyInfoPair
= allSubDirList.get(subDirRecursiveCnt);
PurgePathRequest request = prepareDeleteDirRequest(
remainNum, stringOmKeyInfoPair.getValue(),
- stringOmKeyInfoPair.getKey(), allSubDirList,
- keyManager);
- if (isBufferLimitCrossed(remainingBufLimit, consumedSize,
- request.getSerializedSize())) {
- // ignore further add request
+ stringOmKeyInfoPair.getKey(), allSubDirList, keyManager,
+ remainingBufLimit);
+ if (request == null) {
Review Comment:
Removed
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/AbstractKeyDeletingService.java:
##########
@@ -375,10 +378,12 @@ protected PurgePathRequest prepareDeleteDirRequest(
}
// step-2: get all sub files under the deletedDir
- List<OmKeyInfo> subFiles = keyManager
- .getPendingDeletionSubFiles(volumeId, bucketId,
- pendingDeletedDirInfo, remainNum);
+ DeleteKeysResult subFileDeleteResult =
+ keyManager.getPendingDeletionSubFiles(volumeId, bucketId,
+ pendingDeletedDirInfo, remainingBufLimit);
+ List<OmKeyInfo> subFiles = subFileDeleteResult.getKeysToDelete();
remainNum = remainNum - subFiles.size();
+ remainingBufLimit -= subDirDeleteResult.getConsumedSize();
Review Comment:
done.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMetrics.java:
##########
@@ -1505,6 +1509,14 @@ public void incNumRecoverLeaseFails() {
numRecoverLeaseFails.incr();
}
+ public void incNumSuccessfulIterationsDirDeletingService() {
+ numSuccessfulIterationsDirDeletingService.incr();
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]