Simplify ConcreteIndices and its usage in TransportBulkAction#81098
Merged
martijnvg merged 4 commits intoelastic:masterfrom Nov 30, 2021
Merged
Simplify ConcreteIndices and its usage in TransportBulkAction#81098martijnvg merged 4 commits intoelastic:masterfrom
martijnvg merged 4 commits intoelastic:masterfrom
Conversation
martijnvg
commented
Nov 29, 2021
| // create failures for all relevant requests | ||
| for (BulkItemRequest request : requests) { | ||
| final String indexName = concreteIndices.getConcreteIndex(request.index()).getName(); | ||
| final String indexName = request.index(); |
Member
Author
There was a problem hiding this comment.
No need to lookup Index from ConcreteIndices if we just use it as name in an exception message.
Member
There was a problem hiding this comment.
I suspect that this one line could give some pretty big memory savings on the coordinating node sometimes. Prior to this change we'd retain a reference to the ConcreteIndices (and therefore the ClusterState) while the request was ongoing. Now we don't. Great stuff. 🎉
martijnvg
commented
Nov 29, 2021
| addFailure(request, idx, cannotCreate); | ||
| return true; | ||
| } | ||
| Index concreteIndex = concreteIndices.getConcreteIndex(request.index()); |
Member
Author
There was a problem hiding this comment.
The ConcreteIndices#resolveIfAbsent(...) already checks whether an Index instance has been cached, so
no need to this here as well.
martijnvg
commented
Nov 29, 2021
| this.indexNameExpressionResolver = indexNameExpressionResolver; | ||
| } | ||
|
|
||
| Index getConcreteIndex(String indexOrAlias) { |
Member
Author
There was a problem hiding this comment.
After removing the above two usages, this method can be removed as it is no longer used.
weizijun
added a commit
to weizijun/elasticsearch
that referenced
this pull request
Nov 30, 2021
* upstream/master: [ML] Parent datafeed actions to the datafeed's persistent task (elastic#81143) Simplify ConcreteIndices and its usage in TransportBulkAction (elastic#81098) Unmute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test (elastic#81142) TSDB: Do not allow index splits for time series indices (elastic#81125) Reduce verbosity-increase timeout to 3m (elastic#81118) Mute DataStreamsSnapshotsIT#testRestoreDataStreamAliasWithConflictingIndicesAlias() test Fix stopping of old elasticsearch cluster (elastic#81059) Fix data stream alias validation. (elastic#81040) Add replicated field to get data stream api response. (elastic#80988)
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.
No description provided.