-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Transform] Make use of delegateFailureAndWrap #106034
Conversation
Refactoring to a later pattern of ActionListener, reducing memory footprint and removing some redudant lines of code.
Pinging @elastic/ml-core (Team:ML) |
unusedValidationResponse -> putTransform(request, listener), | ||
listener::onFailure | ||
ActionListener<ValidateTransformAction.Response> validateTransformListener = listener.delegateFailureAndWrap( | ||
(paramListener, unused) -> putTransform(request, paramListener) |
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 should also settle on the naming for the lambda parameter, here paramListener
. If you look at the recent refactoring PR (#105907), we chose l
as the name, although I'm fine with any other name, just please keep it consistent throughout the file.
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.
Went with l
since that is what the previous PR did (I thought it was delegate
but was mistaken)
transformConfigManager.putTransformConfiguration(config, putTransformConfigurationListener); | ||
var config = request.getConfig(); | ||
transformConfigManager.putTransformConfiguration(config, listener.delegateFailureAndWrap((paramListener, unused) -> { | ||
var configId = config.getId(); |
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 usually use transformId
for this. Could you use this name here too?
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
@elasticmachine update branch |
* [Transform] Make use of delegateFailureAndWrap Refactoring to a later pattern of ActionListener, reducing memory footprint and removing some redudant lines of code. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Refactoring to a later pattern of ActionListener, reducing memory footprint and removing some redudant lines of code.