-
Notifications
You must be signed in to change notification settings - Fork 589
HDDS-10292. Extract configurator for size settings from MiniOzoneCluster #6167
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
Conversation
…nt unit parameter; remove separation of config source/target
szetszwo
left a comment
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.
@adoroszlai , thanks for working on this! I have to quick comments inlined.
| private OptionalLong blockSize = OptionalLong.empty(); | ||
| private OptionalInt streamBufferSize = OptionalInt.empty(); | ||
| private OptionalLong streamBufferFlushSize = OptionalLong.empty(); | ||
| private OptionalLong dataStreamBufferFlushSize = OptionalLong.empty(); | ||
| private OptionalLong dataStreamWindowSize = OptionalLong.empty(); | ||
| private OptionalLong streamBufferMaxSize = OptionalLong.empty(); | ||
| private OptionalInt dataStreamMinPacketSize = OptionalInt.empty(); |
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.
Let's also change the fields to not to use Optional. In general, it is not a good practice to use Optional as a field. See this comment by Brian Goetz (the main author of Java Concurrency in Practice).
You should almost never use it as a field of something or a method parameter.
| /** | ||
| * Helper for tests that want to set client stream properties. | ||
| */ | ||
| public final class ClientConfigBuilder { |
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.
Since this is for testing only, how about calling git ClientConfigForTesting?
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 suggestion. I wasn't quite happy with the original name, but couldn't find a better one.
szetszwo
left a comment
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.
+1 the change looks good.
|
Thanks @szetszwo for the review. |
What changes were proposed in this pull request?
Create a dedicated configurator object for setting the following properties for tests, instead of polluting
MiniOzoneCluster.Builderinterface:blockSizechunkSizedataStreamBufferFlushSizedataStreamMinPacketSizedatastreamWindowSizestreamBufferFlushSizestreamBufferMaxSizestreamBufferSizeThe first commit in the PR (284f3ec) tries to minimize change for easier review. Follow-up commits are minor additional improvements.
Moving the default values for these properties to
ozone-site.xmluncovered a problem withOzoneClientConfigconstruction, which is also fixed here (445db63). (See #6163 for similar fix in prod. code.)https://issues.apache.org/jira/browse/HDDS-10292
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/7782795270