HDDS-15881. Support setting storagePolicy via SetBucketProperty - #11232
Open
anuragp010 wants to merge 1 commit into
Open
anuragp010 wants to merge 1 commit into
anuragp010 wants to merge 1 commit into
Conversation
anuragp010
marked this pull request as ready for review
September 11, 2026 18:51
sarvekshayr
reviewed
Sep 15, 2026
sarvekshayr
left a comment
Contributor
There was a problem hiding this comment.
Thanks @anuragp010 for the patch. Please address the below inline comments.
| } | ||
|
|
||
| @Test | ||
| @SuppressWarnings("methodlength") |
Contributor
There was a problem hiding this comment.
Avoid @SuppressWarnings in new code. Also applies to test method testShUpdateBucketStoragePolicy.
Comment on lines
+73
to
+74
| description = "Bucket StoragePolicy. Allowed values: HOT, WARM, COLD, null. Default: WARM.", | ||
| defaultValue = "WARM") |
Contributor
There was a problem hiding this comment.
Use the showDefaultValue attribute instead of adding default in description.
Suggested change
| description = "Bucket StoragePolicy. Allowed values: HOT, WARM, COLD, null. Default: WARM.", | |
| defaultValue = "WARM") | |
| description = "Bucket StoragePolicy. Allowed values: HOT, WARM, COLD, null.", | |
| defaultValue = "WARM", | |
| showDefaultValue = CommandLine.Help.Visibility.ALWAYS) |
| description = "When true, allocation may fall back to the StoragePolicy's " + | ||
| "fallback tier if the creation tier is unavailable. Default: true.", | ||
| defaultValue = "true") | ||
| private String allowFallBackStoragePolicyStr; |
Contributor
There was a problem hiding this comment.
Can we use boolean instead of String for allowFallBackStoragePolicy field?
Suggested change
| private String allowFallBackStoragePolicyStr; | |
| private boolean allowFallBackStoragePolicy; |
Use the showDefaultValue attribute instead of adding default in description.
| public static final String STORAGE_TYPE = "storageType"; | ||
| public static final String STORAGE_POLICY = "storagePolicy"; | ||
| public static final String ALLOW_FALLBACK_STORAGE_POLICY = "allowFallbackStoragePolicy"; | ||
| public static final String UNSET_STORAGE_POLICY = "unSetStoragePolicy"; |
Contributor
There was a problem hiding this comment.
nit: Let’s use unset as it reads better than unSet.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
This PR adds client-facing support for managing a bucket's storage policy. The
ozone sh bucket createandbucket updatecommands now support--storage-policy/-sto set a storage policy and--allow-fallback-storage-policy/-ato enable or disable fallback. Passing--storage-policy nullonbucket updateindicates the storage policy should be unset, which required wiring from the client side through the proto layer to the server side. This patch represents patch-15 of the storage policy series and diverges from the original in its CLI flags, as picocli's style check now rejects the original-sp,-asp, and--allowFallBackStoragePolicy.What is the link to the Apache JIRA
HDDS-15881
How was this patch tested?