-
Notifications
You must be signed in to change notification settings - Fork 491
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-8702. Extract handler for reconfigurable properties #4794
Conversation
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. Just a little commented you can refer to
@Override | ||
public String reconfigurePropertyImpl(String property, String newValue) { | ||
return properties.getOrDefault(property, identity()) | ||
.apply(newValue); |
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.
maybe we only return the newValue String when the reconfig is execute normal, If the request property
is not contain in the properties
, we can throw an exception.
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.
maybe we only return the newValue String when the reconfig is execute normal, If the request
property
is not contain in theproperties
, we can throw an exception.
Now do nothing if the request property is not contain in the properties. We can see the result by exe status
.
Thanks @adoroszlai for providing an elegant refactoring. I tested the PR in compose environment again and the result is as expected. |
Thanks @whbing, @xichen01 for the review. I have updated the patch based on your suggestion (which seems to have been deleted) to also implement CI is still running in my fork, will mark this ready for review if it succeeds. |
+1 |
@captainzmc @dombizita please review |
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 @adoroszlai for the patch. The refactoring looks good. Let's merge this.
Thanks @captainzmc, @whbing, @xichen01 for the review. |
What changes were proposed in this pull request?
Some logic related to reconfiguration can be refactored into a common handler object to reduce the complexity and avoid duplication.
https://issues.apache.org/jira/browse/HDDS-8702
How was this patch tested?
Added unit test, refactored existing integration test.
Tested CLI commands in
ozone
compose environment.https://github.com/adoroszlai/hadoop-ozone/actions/runs/5117942592