-
Notifications
You must be signed in to change notification settings - Fork 616
HDDS-9534. Support namespace summaries (du, dist & counts) for LEGACY buckets with file system disabled #5517
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a19f92a
HDDS-9534. Support namespace summaries (du, dist & counts) for LEGACY…
ArafatKhan2198 fdad043
Removed the extra parameter added to NSSummary
ArafatKhan2198 0e1fe0d
Modified the process method of NSSummaryTaskWitLegacy to handle Legac…
ArafatKhan2198 c86182e
Added more java docs and refactoring
ArafatKhan2198 beabd5a
Added java docs and Logs
ArafatKhan2198 a3db461
Using OBSBucketHanlder in case fileSystemPathEnabled flag set to true…
ArafatKhan2198 f9dc5cf
Fixes a few edge cases
ArafatKhan2198 f40e121
Added Unit tests
ArafatKhan2198 e56c3bf
Added unit tests for NSSummaryEndpoint With OBS and Legacy buckets
ArafatKhan2198 76c0262
Fixed config flag for legacy buckets
ArafatKhan2198 cb83bda
Added more unit tests for the key level
ArafatKhan2198 d15231f
Added licence header and fixed checkstyle issues
ArafatKhan2198 ab9cb00
Renamed a variable
ArafatKhan2198 f637dd6
Fixed failing UT's
ArafatKhan2198 3e5d5e6
Fixed checkstyle issues
ArafatKhan2198 14a0382
Added a test to test out the utility method normalizePathUptilBucket
ArafatKhan2198 0b1f99c
Fixed checkstyle issue
ArafatKhan2198 efe3ebf
Renamed setParentDirectoryId to setKeyParentID
ArafatKhan2198 b7df717
Made review changes
ArafatKhan2198 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -743,6 +743,46 @@ public static String normalizeKey(String keyName, | |||||
| return keyName; | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Normalizes a given path up to the bucket level. | ||||||
| * | ||||||
| * This method takes a path as input and normalises uptil the bucket level. | ||||||
| * It handles empty, removes leading slashes, and splits the path into | ||||||
| * segments. It then extracts the volume and bucket names, forming a | ||||||
| * normalized path with a single slash. Finally, any remaining segments are | ||||||
| * joined as the key name, returning the complete standardized path. | ||||||
| * | ||||||
| * @param path The path string to be normalized. | ||||||
| * @return The normalized path string. | ||||||
| */ | ||||||
| public static String normalizePathUptilBucket(String path) { | ||||||
|
ArafatKhan2198 marked this conversation as resolved.
Outdated
|
||||||
| if (path == null || path.isEmpty()) { | ||||||
| return "/"; // Handle empty path | ||||||
|
ArafatKhan2198 marked this conversation as resolved.
Outdated
|
||||||
| } | ||||||
|
|
||||||
| // Remove leading slashes | ||||||
| path = path.replaceAll("^/*", ""); | ||||||
|
|
||||||
| String[] segments = path.split("/", -1); | ||||||
|
|
||||||
| String volumeName = segments[0]; | ||||||
| String bucketName = segments.length > 1 ? segments[1] : ""; | ||||||
|
|
||||||
| // Combine volume and bucket. | ||||||
| StringBuilder normalizedPath = new StringBuilder(volumeName); | ||||||
| if (!bucketName.isEmpty()) { | ||||||
| normalizedPath.append("/").append(bucketName); | ||||||
|
ArafatKhan2198 marked this conversation as resolved.
Outdated
|
||||||
| } | ||||||
|
|
||||||
| // Add remaining segments as the key | ||||||
| if (segments.length > 2) { | ||||||
| normalizedPath.append("/").append( | ||||||
|
ArafatKhan2198 marked this conversation as resolved.
Outdated
|
||||||
| String.join("/", Arrays.copyOfRange(segments, 2, segments.length))); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| return normalizedPath.toString(); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| /** | ||||||
| * For a given service ID, return list of configured OM hosts. | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.