ChenSammi commented on code in PR #8909:
URL: https://github.com/apache/ozone/pull/8909#discussion_r2286813311
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -339,47 +333,54 @@ private void evaluateFSOBucket(OmVolumeArgs volume,
OmBucketInfo bucket, String
continue;
}
// use last directory's object ID to iterate the keys
- String prefix = OzoneConsts.OM_KEY_PREFIX + volume.getObjectID() +
- OzoneConsts.OM_KEY_PREFIX + bucket.getObjectID() +
OzoneConsts.OM_KEY_PREFIX;
+ String prefix = OM_KEY_PREFIX + volume.getObjectID() +
+ OM_KEY_PREFIX + bucket.getObjectID() + OM_KEY_PREFIX;
StringBuffer directoryPath = new StringBuffer();
if (!dirList.isEmpty()) {
prefix += dirList.get(dirList.size() - 1).getObjectID();
for (OmDirectoryInfo dir : dirList) {
-
directoryPath.append(dir.getName()).append(OzoneConsts.OM_KEY_PREFIX);
+ directoryPath.append(dir.getName()).append(OM_KEY_PREFIX);
}
- if (directoryPath.toString().equals(rule.getEffectivePrefix() +
OzoneConsts.OM_KEY_PREFIX)) {
- expiredDirList.add(directoryPath.toString());
- expiredDirUpdateIDList.add(dirList.get(dirList.size() -
1).getUpdateID());
+ if (directoryPath.toString().equals(rule.getEffectivePrefix() +
OM_KEY_PREFIX)) {
+ if (!expiredDirList.add(directoryPath.toString(),
dirList.get(dirList.size() - 1).getUpdateID())) {
+ // if expiredDirList is full, send delete request for pending
deletion directories
+ sendDeleteKeysRequestAndClearList(volume.getVolume(),
bucket.getBucketName(),
+ expiredDirList, true);
+ expiredDirList.add(directoryPath.toString(),
dirList.get(dirList.size() - 1).getUpdateID());
+ }
}
}
LOG.info("Prefix {} for {}", prefix, bucketKey);
- evaluateKeyTable(keyTable, prefix, directoryPath.toString(), rule,
expiredKeyList,
- expiredKeyUpdateIDList, bucketKey);
evaluateDirTable(directoryInfoTable, prefix, directoryPath.toString(),
rule,
- expiredDirList, expiredDirUpdateIDList, bucketKey);
+ expiredDirList, bucket);
+ evaluateKeyTable(keyTable, prefix, directoryPath.toString(), rule,
expiredKeyList, bucket);
Review Comment:
The order is switched because once directory is moved to deleted table, OM
directory deletion service will help to bring all the sub directories and files
under it to deleted state too.
--
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]