Refactor IndexAbstraction to not use IndexMetadata#79246
Merged
martijnvg merged 2 commits intoelastic:7.xfrom Oct 15, 2021
Merged
Refactor IndexAbstraction to not use IndexMetadata#79246martijnvg merged 2 commits intoelastic:7.xfrom
martijnvg merged 2 commits intoelastic:7.xfrom
Conversation
Backport of elastic#79080 to 7.x branch. Most users of an `IndexAbstraction` instance doesn't need to use the `IndexMetadata` instances that `getIndices()` and `getWriteIndex()` returns. Cluster state variables/parameters can be used in places that access to `IndexMetadata` is required. By changing the `getIndices()` and `getWriteIndex()` methods to return `Index` instance, the indices lookup can be reused across different cluster states. This should be possible in cases that don't change an index hidden status or open and closes indices or when adding / removing aliases, data streams or indices. This change should allow for elastic#79004
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.
Backport of #79080 to 7.x branch.
Most users of an
IndexAbstractioninstance doesn't need to use theIndexMetadatainstances thatgetIndices()andgetWriteIndex()returns.Cluster state variables/parameters can be used in places that access to
IndexMetadatais required.By changing the
getIndices()andgetWriteIndex()methods to returnIndexinstance, the indices lookup can be reused across different cluster states.
This should be possible in cases that don't change an index hidden status or
open and closes indices or when adding / removing aliases, data streams or indices.
This change should allow for #79004