devmadhuu commented on code in PR #8091:
URL: https://github.com/apache/ozone/pull/8091#discussion_r1997488919
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java:
##########
@@ -111,23 +124,34 @@ public TaskResult reprocess(OMMetadataManager
omMetadataManager) {
init();
for (String tableName : tables) {
Table table = omMetadataManager.getTable(tableName);
-
- try (TableIterator<String, ? extends Table.KeyValue<String, ?>> iterator
- = table.iterator()) {
+ try {
if (tableHandlers.containsKey(tableName)) {
- Triple<Long, Long, Long> details =
- tableHandlers.get(tableName).getTableSizeAndCount(iterator);
- objectCountMap.put(getTableCountKeyFromTable(tableName),
- details.getLeft());
- unReplicatedSizeMap.put(
- getUnReplicatedSizeKeyFromTable(tableName), details.getMiddle());
- replicatedSizeMap.put(getReplicatedSizeKeyFromTable(tableName),
- details.getRight());
+ try (TableIterator<String, ? extends Table.KeyValue<String, ?>>
iterator
+ = table.iterator()) {
+ Triple<Long, Long, Long> details =
+ tableHandlers.get(tableName).getTableSizeAndCount(iterator);
+ objectCountMap.put(getTableCountKeyFromTable(tableName),
+ details.getLeft());
+ unReplicatedSizeMap.put(
+ getUnReplicatedSizeKeyFromTable(tableName),
details.getMiddle());
+ replicatedSizeMap.put(getReplicatedSizeKeyFromTable(tableName),
+ details.getRight());
+ }
} else {
- long count = Iterators.size(iterator);
- objectCountMap.put(getTableCountKeyFromTable(tableName), count);
+ AtomicLong count = new AtomicLong(0);
+ try (ParallelTableIteratorOperation<String, byte[]>
parallelTableIteratorOperation =
+ new ParallelTableIteratorOperation<>(omMetadataManager,
Review Comment:
Not sure if we need this just for the count of table records. Did we try
testing this #8069 as well ?
--
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]