errose28 commented on a change in pull request #3206:
URL: https://github.com/apache/ozone/pull/3206#discussion_r831316668
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMOpenKeysDeleteResponse.java
##########
@@ -67,9 +72,15 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
Table<String, OmKeyInfo> openKeyTable =
omMetadataManager.getOpenKeyTable(getBucketLayout());
- for (Map.Entry<String, OmKeyInfo> keyInfoPair: keysToDelete.entrySet()) {
+ for (Map.Entry<String, OmKeyInfo> keyInfoPair : keysToDelete.entrySet()) {
addDeletionToBatch(omMetadataManager, batchOperation, openKeyTable,
keyInfoPair.getKey(), keyInfoPair.getValue());
}
+
+ for (Map.Entry<String, OmBucketInfo> bucketInfoPair
+ : bucketsToUpdate.entrySet()) {
+ omMetadataManager.getBucketTable().putWithBatch(batchOperation,
Review comment:
Since the bucket table is now being updated for the quota info, it needs
to be added to the cleanup table annotation on this class.
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java
##########
@@ -585,11 +586,15 @@ protected static long sumBlockLengths(OmKeyInfo
omKeyInfo) {
/**
* Return bucket info for the specified bucket.
*/
+ @Nullable
protected OmBucketInfo getBucketInfo(OMMetadataManager omMetadataManager,
String volume, String bucket) {
- return omMetadataManager.getBucketTable().getCacheValue(
- new CacheKey<>(omMetadataManager.getBucketKey(volume, bucket)))
- .getCacheValue();
+ String bucketKey = omMetadataManager.getBucketKey(volume, bucket);
+
+ CacheValue<OmBucketInfo> value = omMetadataManager.getBucketTable()
+ .getCacheValue(new CacheKey<>(bucketKey));
+
+ return value != null ? value.getCacheValue() : null;
Review comment:
Ideally this method would do a normal key read and not strictly a cache
read. The result would be the same but it would no longer depend on the bucket
table being a full cache, which is an implementation detail outside of this
class.
--
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]