-
Notifications
You must be signed in to change notification settings - Fork 507
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
HDDS-9260. Optimize OmDbInsight API to avoid redundant recursive size calculations for deleted directories during data retrieval. #5265
Conversation
… calculations for deleted directories during data retrieval.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/OMDBInsightEndpoint.java
Show resolved
Hide resolved
… Integration tests to verfiy the result
@devmadhuu @sumitagrawl @ashishkumar50 can you please look |
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. LGTM +1
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NSSummary.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.
Thanks @ArafatKhan2198 for working on this.
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 I have few scenario which seems not handled,
- if sub-directory is removed, then the sub-dir size is not removed from parent -- This needs re-calculation again -- This is major issue with this implementation as needs recursive update till its parent
- NSSummary when save to DB need extra field also, may not be much problem
Additionally,
|
What changes were proposed in this pull request?
In the current implementation of
omdbInsights
, the calculation of sizes fordeleted directories
occurs dynamically when needed. The respective NSSummary object associated with a deleted directory does not retain the directory's size information. Consequently, we must repeatedly traverse the directory structure recursively to calculate its size whenever the omdbInsights endpoint is invoked.To eliminate the redundancy, we can store the calculated size within the corresponding NSSummary objects. This means that the next time we need to determine the size of a specific deleted directory, we can retrieve the stored size value directly, avoiding the need for recomputation.
It's important to note that this approach is effective for deleted directories, as their size remains constant once they are deleted. Unlike normal directories, where size can change dynamically as files are added or removed, the size of deleted directories remains constant, making it a suitable candidate for this optimization.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9260
How was this patch tested?
Integration Tests