-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-8627. Recon - API for Count of deletePending directories #5037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@devmadhuu @dombizita @ashishkumar50 can you please take a look ! |
ashishkumar50
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArafatKhan2198, Thanks for working on this. Please find few comments inline.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestOmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArafatKhan2198 thanks for working on this patch, can you pls elaborate the purpose of this method since you added tableName as extra parameter now. Is this method only for counting records of tables which are having keys as OMKeyInfo and RepeatedOmKeyInfo only ?. Also if GlobalStatsTable will not have counts of OpenFile and OpenKey table ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
46e87e1 to
b615472
Compare
b615472 to
9357281
Compare
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenKeysInsightHandler.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenKeysInsightHandler.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenKeyTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenKeyTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenFileTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenFileTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableHandler.java
Show resolved
Hide resolved
...ne/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedDirectoryTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenFileTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenFileTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedTableHandler.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedTableHandler.java
Show resolved
Hide resolved
...ne/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedDirectoryTableHandler.java
Outdated
Show resolved
Hide resolved
...ne/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedDirectoryTableHandler.java
Outdated
Show resolved
Hide resolved
|
@devmadhuu @adoroszlai @ashishkumar50 |
devmadhuu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ArafatKhan2198 for continued effort on this. Mostly looks good to me except few minor comments.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableHandler.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableHandler.java
Show resolved
Hide resolved
...ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedKeysInsightHandler.java
Outdated
Show resolved
Hide resolved
...ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedKeysInsightHandler.java
Outdated
Show resolved
Hide resolved
sumitagrawl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArafatKhan2198 Thanks for working over this, IMO, this insight is not required as its very difficult to handle dynamic scenario, and further can not see further use case as already we have implemented api to give "pending deletion size".
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Show resolved
Hide resolved
...econ/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedDirectoriesInsightHandler.java
Outdated
Show resolved
Hide resolved
...econ/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedDirectoriesInsightHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/OMMetadataManagerTestUtils.java
Show resolved
Hide resolved
...op-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestOmTableInsightTask.java
Show resolved
Hide resolved
|
Initially, we attempted to implement the DU space calculation of deleted directories using To address the challenge of calculating the size of deleted directories, especially when encountering both parent and child entries in the cc: @devmadhuu @dombizita |
devmadhuu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ArafatKhan2198 for continued effort on this patch. Few comments, Pls check.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconNamespaceSummaryManagerImpl.java
Outdated
Show resolved
Hide resolved
...ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/DeletedKeysInsightHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OmTableInsightTask.java
Outdated
Show resolved
Hide resolved
...op-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/OpenKeysInsightHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestEndpoints.java
Outdated
Show resolved
Hide resolved
…ndlers for verification instead
sumitagrawl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Please adjust the Jira (HDDS-8627) title and description to the changes discussed during the PR review @ArafatKhan2198 @sumitagrawl |
Thanks for pointing it out will do! |
What changes were proposed in this pull request?
1. This PR does two main things :-
OmTableInsightTaskfigure out the total count of directories marked for deletion.2. Finding the Count of Deleted Directories: :-
3. Refactoring the OmTableInsightTask :-
process()andreprocess()methods long and complicated.OpenKeysInsightHandler, DeletedKeysInsightHandler) that handle specific tasks for each table.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8627
How was this patch tested?
Unit Testing and Manual Testing