-
Notifications
You must be signed in to change notification settings - Fork 509
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-9534. Support namespace summaries (du, dist & counts) for LEGACY buckets with file system disabled #5517
Conversation
@devmadhuu @adoroszlai @GeorgeJahad Could you please take a look !! |
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
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 over this, can add testcases for OBS Legacy type
...zone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/LegacyBucketHandler.java
Outdated
Show resolved
Hide resolved
...zone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/LegacyBucketHandler.java
Outdated
Show resolved
Hide resolved
...zone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/LegacyBucketHandler.java
Outdated
Show resolved
Hide resolved
...zone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/LegacyBucketHandler.java
Outdated
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Outdated
Show resolved
Hide resolved
Thanks for the comments @sumitagrawl as informed I will have to merge this one first #4245 and then move on to incorporate the comments posted by you on this PR. |
… buckets with file system disabled.
…y buckets with OBS layout
521d9ef
to
c86182e
Compare
… for Legacy buckets
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 Plz check, given few minor comments
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/EntityHandler.java
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.
LGTM+1
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 effort on this @ArafatKhan2198, it looks good to me, I have one minor comment.
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.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 continue working on this patch. Just few Nits
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
Outdated
Show resolved
Hide resolved
// Add remaining segments as the key | ||
if (segments.length > 2) { | ||
normalizedPath.append("/").append( | ||
String.join("/", Arrays.copyOfRange(segments, 2, segments.length))); |
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.
String.join("/", Arrays.copyOfRange(segments, 2, segments.length))); | |
String.join(OM_KEY_PREFIX, Arrays.copyOfRange(segments, 2, segments.length))); |
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Outdated
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Outdated
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Show resolved
Hide resolved
...p-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskWithLegacy.java
Show resolved
Hide resolved
@ArafatKhan2198 , you can ignore If (LOG.isDebugEnabled()) comments, as current logger library being used is already having check of |
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 . LGTM +1
Thanks @dombizita @sumitagrawl for review. |
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
… for LEGACY buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519) Change-Id: I6c05f74e99cd1628d0f8489f71f1f092b9ca896f
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
… buckets with file system disabled (apache#5517) (cherry picked from commit cb5d519)
What changes were proposed in this pull request?
Recon NSSummaries currently support
FSO
,OBS
buckets, andLegacy
buckets with theFSEnabled
flag set totrue
. WhenFSEnabled
isfalse
, Legacy buckets act like OBS buckets, requiring a similar approach for managing keys. We've adapted our OBS bucket handling methods for these cases, maximizing code reuse.Here's a breakdown of the changes :-
NSSummaryTaskWithLegacy.java
: This includes methods to process keys in Legacy buckets, distinguishing between filesystem and object store layouts to generate NSSummaries accurately.BucketHandler.java
: Depending on whether FileSystemPaths is enabled, we assign the appropriate handler for each bucket. For Legacy buckets with disabled FileSystemPaths, we employ OBS bucket handler, thanks to their identical key management approach.EntityHandler.java
: This class is activated by theNSSummaryEndpoint
and determines which handler to assign based on the path provided by the user. For Legacy buckets with the FileSystemPaths option disabled, we directly employ the OBSHandler and its associated methods. We have introduced specific normalization methods for OBS keys. OBS keys follow the formatvolumeName/bucketName/keyName
, where the keyName can include any characters, even multiple slashes, such as “////KeyName.
” There's no need to normalize the keyName itself, but it's essential to ensure the path up to the bucket is correctly normalized. This is because volumeName and bucketName must not contain multiple slashes or spaces. Our standard normalization methods for the FSO layout normalize the entire path, including the keyName, which could alter the keyName and lead to invalid output. To address this, I've added a method in the OmUtils.java class that normalizes the path up to the bucket level.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9534
How was this patch tested?
Manual Testing and Unit Testing