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.
Replace deprecated methods to support Kafka 4.0.0 #2254
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
Replace deprecated methods to support Kafka 4.0.0 #2254
Changes from 6 commits
5715b0d
57cb00d
2eb5a98
237d547
1dbff28
21ae74b
93bd379
db8af2b
835816c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We could also abstract these the above lines into a
getTopicDescription()
method to simplify the code across here and the tests even further. If you want to go that route you could separate the code like this:Note that if you did this, it would probably be a good idea to create a custom exception class in the
cruisecontrol.metricsreporter/exception
folder so you don't have to add all the Exception classes to the method signatures where this method is called.This way, you can just call
getTopicDescription()
whenever you need the topic description for a topic and not worry about calling and invoking the right method there as well, it would just be done in the method here in theCruiseControlMetricsReporter
class.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.
I was looking into applying this suggestion but there is one more thing -> The call made in
CruiseControlMetricsReporter
iswhile in the test we don't use the
get
method withCLIENT_REQUEST_TIMEOUT_MS, TimeUnit.MILLISECONDS
parametersThere 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.
Does the inclusion of
.get(CLIENT_REQUEST_TIMEOUT_MS, TimeUnit.MILLISECONDS)
interfere with the tests? From what I understand, it still returns theTopicDescription
object we need.Even if the inclusion of
.get(CLIENT_REQUEST_TIMEOUT_MS, TimeUnit.MILLISECONDS)
did cause any problems in the tests, couldn't we remove it from thegetTopicDescription()
method itself and append it to the end of the places where we need it?