Updating ingest pipeline without changes is no-op#78196
Merged
danhermann merged 6 commits intoelastic:masterfrom Sep 22, 2021
Merged
Updating ingest pipeline without changes is no-op#78196danhermann merged 6 commits intoelastic:masterfrom
danhermann merged 6 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
martijnvg
approved these changes
Sep 22, 2021
| } | ||
| ingestService.putPipeline(ingestInfos, request, listener); | ||
| }, listener::onFailure)); | ||
| nodesInfoRequest.clear().addMetric(NodesInfoRequest.Metric.INGEST.metricName()); |
Member
There was a problem hiding this comment.
Not really part of your change, but since it is touched now, maybe avoid chaining? And instead just:
nodesInfoRequest.clear();
nodesInfoRequest..addMetric(NodesInfoRequest.Metric.INGEST.metricName());
I think that is easier to read.
| if (currentIngestMetadata != null && currentIngestMetadata.getPipelines().containsKey(request.getId())) { | ||
| pipelineConfig = XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2(); | ||
| var currentPipeline = currentIngestMetadata.getPipelines().get(request.getId()); | ||
| if (currentPipeline.getConfigAsMap().equals(pipelineConfig)) { |
Member
There was a problem hiding this comment.
I was wondering whether Maps.deepEquals(...) be used here? But I don't think that is the case since we never have arrays as value in this map. So this should be good.
|
|
||
| var pipelineId = randomAlphaOfLength(5); | ||
| var value = randomAlphaOfLength(5); | ||
| var pipelineString = "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"" + value + "\"}}]}"; |
Member
There was a problem hiding this comment.
Maybe create a variant of this test that creates a random deep map? I don't think PipelineConfiguration cares about that content being valid.
Contributor
Author
|
@elasticmachine update branch |
Contributor
Author
|
Thanks, @martijnvg! |
danhermann
added a commit
to danhermann/elasticsearch
that referenced
this pull request
Oct 6, 2021
danhermann
added a commit
that referenced
this pull request
Oct 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #77382.