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: [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]