You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/04/29 04:55:36 UTC

[GitHub] [ozone] kerneltime commented on a diff in pull request #3282: HDDS-6563. Revert "HDDS-5867. Update quota when deleting open keys"

kerneltime commented on code in PR #3282:
URL: https://github.com/apache/ozone/pull/3282#discussion_r861458646


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMOpenKeysDeleteRequest.java:
##########
@@ -88,25 +87,19 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
     OMClientResponse omClientResponse = null;
     Result result = null;
     Map<String, OmKeyInfo> deletedOpenKeys = new HashMap<>();
-    Map<String, OmBucketInfo> updatedBuckets = new HashMap<>();
 
     try {
       for (OpenKeyBucket openKeyBucket: submittedOpenKeyBuckets) {
         // For each bucket where keys will be deleted from,
         // get its bucket lock and update the cache accordingly.
-        OmBucketInfo omBucketInfo = updateTableCachePerBucket(
-            ozoneManager, trxnLogIndex, openKeyBucket, deletedOpenKeys);
-
-        if (omBucketInfo != null) {
-          String bucketKey = ozoneManager.getMetadataManager()
-              .getBucketKey(openKeyBucket.getVolumeName(),
-                  openKeyBucket.getBucketName());
-          updatedBuckets.put(bucketKey, omBucketInfo);
-        }
+        Map<String, OmKeyInfo> deleted = updateOpenKeyTableCache(ozoneManager,

Review Comment:
   I think `deleted` can be skipped and all the keys added to `deletedOpenKeys`?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMOpenKeysDeleteRequest.java:
##########
@@ -88,25 +87,19 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
     OMClientResponse omClientResponse = null;
     Result result = null;
     Map<String, OmKeyInfo> deletedOpenKeys = new HashMap<>();
-    Map<String, OmBucketInfo> updatedBuckets = new HashMap<>();
 
     try {
       for (OpenKeyBucket openKeyBucket: submittedOpenKeyBuckets) {
         // For each bucket where keys will be deleted from,
         // get its bucket lock and update the cache accordingly.
-        OmBucketInfo omBucketInfo = updateTableCachePerBucket(
-            ozoneManager, trxnLogIndex, openKeyBucket, deletedOpenKeys);

Review Comment:
   Why not continue to pass `deletedOpenKeys` and avoid the additional allocations?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org