rich7420 commented on code in PR #11386:
URL: https://github.com/apache/ozone/pull/11386#discussion_r4172861638
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -503,6 +507,28 @@ private void scanDeletedTables(
snapshotDeletedDirMap, sourceLabel);
}
+ private void recalculateActiveDeletedKeyUsages(
+ OMMetadataManager metadataManager,
+ Map<Long, OmBucketInfo> bucketById,
+ Map<String, CountPair> snapshotCountByBucketNameKey)
+ throws UncheckedIOException, UncheckedExecutionException {
+ Codec<RepeatedOmKeyInfo> codec =
OMDBDefinition.DELETED_TABLE_DEF.getValueCodec();
+ // a typed iterator decodes on this thread, so keep values raw and let the
workers decode
+ try (Table.KeyValueIterator<String, byte[]> keyIter =
metadataManager.getStore()
+ .getTable(OMDBDefinition.DELETED_TABLE, StringCodec.get(),
ByteArrayCodec.get(), CacheType.NO_CACHE)
+ .iterator()) {
Review Comment:
nit: please use `.iterator(null, VALUE_ONLY)` here, with the corresponding
static import. The [consumer only reads
`kv.getValue()`](https://github.com/apache/ozone/blob/1d29e6fd406b0d2818f3b3d70564c61d000a1665/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java#L520-L522),
so we can avoid copying and decoding unused keys.
--
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]