Skip to content

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