Skip to content
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

Refactor InferenceProcessorInfoExtractor to avoid ConfigurationUtils #115425

Merged

Conversation

joegallo
Copy link
Contributor

The ConfigurationUtils are a bit special-purpose -- they read from a mutable config map and they remove keys that have been read. There's other code in the rest of the ingest layer that makes sure that config maps have been exhausted after a processor has been constructed, which makes it part of a mechanism that makes sure that every key in the map is something that we recognize.

Anyway, the uses here in InferenceProcessorInfoExtractor are all 'just' checking the values, but they don't actually need to rely removing the values, so I've rewritten things slightly to avoid the use of ConfigurationUtils altogether.

On its own, this PR doesn't have much to it -- the key thing that's not necessarily obvious from the code is that as a consequence of this PR the InferenceProcessorInfoExtractor will no longer rely on the processor config maps returned from PipelineConfiguration even being mutable at all, which a future PR is going to make be the case.

@joegallo joegallo added >refactoring :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v9.0.0 v8.17.0 labels Oct 23, 2024
@joegallo joegallo requested a review from davidkyle October 23, 2024 14:27
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Makes total sense, thanks for the change

@joegallo joegallo merged commit c851c25 into elastic:main Oct 23, 2024
16 checks passed
@joegallo joegallo deleted the refactor-inference-processor-info-extractor branch October 23, 2024 17:41
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :ml Machine learning >refactoring Team:ML Meta label for the ML team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants