ArafatKhan2198 commented on code in PR #5037:
URL: https://github.com/apache/ozone/pull/5037#discussion_r1258655747


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java:
##########
@@ -139,28 +150,38 @@ public Pair<String, Boolean> reprocess(OMMetadataManager 
omMetadataManager) {
    * Returns a triple with the total count of records (left), total 
unreplicated
    * size (middle), and total replicated size (right) in the given iterator.
    * Increments count for each record and adds the dataSize if a record's value
-   * is an instance of OmKeyInfo. If the iterator is null, returns (0, 0, 0).
+   * is an instance of OmKeyInfo,RepeatedOmKeyInfo.
+   * If the iterator is null, returns (0, 0, 0).
    *
    * @param iterator The iterator over the table to be iterated.
    * @return A Triple with three Long values representing the count,
    *         unreplicated size and replicated size.
    * @throws IOException If an I/O error occurs during the iterator traversal.
    */
   private Triple<Long, Long, Long> getTableSizeAndCount(
-      TableIterator<String, ? extends Table.KeyValue<String, ?>> iterator)
+      TableIterator<String, ? extends Table.KeyValue<String, ?>> iterator,

Review Comment:
   Thanks for the comment @devmadhuu 
   
   The purpose of the `getTableSizeAndCount` method is to calculate the **total 
count of records**, **total unreplicated size, and total replicated** **size** 
in a given iterator over a table, based on the specified tableName. It is only 
used for tables which want both the size as well as the count to be calculated 
hence in our case it will only work for `OPEN_KEY_TABLE`, `OPEN_FILE_TABLE`, 
`DELETED_TABLE` & `DELETED_DIR_TABLE`.
   
   
   
   **Table** **Name** | **Object Associated**
   -- | --
   OPEN_KEY_TABLE | OmKeyInfo
   OPEN_FILE_TABLE | OmKeyInfo
   DELETED_DIR_TABLE | OmKeyInfo
   DELETED_TABLE | RepeatedOmKeyInfo
   
   In our case, the OPEN_KEY_TABLE, OPEN_FILE_TABLE, and DELETED_DIR_TABLE all 
have `OmKeyInfo` associated with them. Therefore, we need to differentiate 
between them based on the table name. The reason for this differentiation is 
because the calculation of data differs for the OPEN_KEY_TABLE and 
OPEN_FILE_TABLE compared to the DELETED_DIR_TABLE.
   
   To summarize, when calculating data for the OPEN_KEY_TABLE and 
OPEN_FILE_TABLE, we consider the dataSize of the keys stored in the OmKeyInfo 
objects. However, for the DELETED_DIR_TABLE, we retrieve the size of the 
deleted directory from the `NSSummary` table. **It's important to note that the 
replicatedSize value is not applicable to the DELETED_DIR_TABLE.**
   
   So, to clarify, the `globalStats` table stores both the `sizes` and `counts` 
of tables, and the `getTableSizeAndCount` method calculates these values and 
updates the globalStats table accordingly.
   
   
   
   
   
   
   
   
   
   
   



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

Reply via email to