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 IndexAbstraction to not use IndexMetadata #79246

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

martijnvg
Copy link
Member

@martijnvg martijnvg commented Oct 15, 2021

Backport of #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 #79004

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
@martijnvg martijnvg merged commit 9eea5a0 into elastic:7.x Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants