sadanand48 commented on code in PR #4941:
URL: https://github.com/apache/ozone/pull/4941#discussion_r1236775314
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -190,7 +241,35 @@ private void repairCount() throws Exception {
}
LOG.info("Completed quota repair for all keys, files and directories");
}
-
+
+ private void updateOldBucketQuotaSupport() {
+ for (Map.Entry<String, OmBucketInfo> entry : nameBucketInfoMap.entrySet())
{
+ if (entry.getValue().getQuotaInBytes() == OLD_QUOTA_DEFAULT
+ || entry.getValue().getQuotaInNamespace() == OLD_QUOTA_DEFAULT) {
+ OmBucketInfo.Builder builder = entry.getValue().toBuilder();
+ if (entry.getValue().getQuotaInBytes() == OLD_QUOTA_DEFAULT) {
+ builder.setQuotaInBytes(QUOTA_RESET);
+ }
+ if (entry.getValue().getQuotaInNamespace() == OLD_QUOTA_DEFAULT) {
+ builder.setQuotaInNamespace(QUOTA_RESET);
+ }
+ OmBucketInfo bucketInfo = builder.build();
+ entry.setValue(bucketInfo);
+
+ // there is a new value to be updated in bucket cache
+ String bucketKey = metadataManager.getBucketKey(
+ bucketInfo.getVolumeName(), bucketInfo.getBucketName());
+ metadataManager.getBucketTable().addCacheEntry(
+ new CacheKey<>(bucketKey),
+ CacheValue.get(EPOCH_DEFAULT, bucketInfo));
Review Comment:
Oh I see it getting committed inside repairCount() !
--
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]