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 AliasOrIndex abstraction. #54394

Merged
merged 2 commits into from
Mar 30, 2020
Merged

Conversation

martijnvg
Copy link
Member

Backport of #53982

In order to prepare the AliasOrIndex abstraction for the introduction of data streams,
the abstraction needs to be made more flexible, because currently it really can be only
an alias or an index.

  • Renamed AliasOrIndex to IndexAbstraction.
  • Introduced a IndexAbstraction.Type enum to indicate what a IndexAbstraction instance is.
  • Replaced the isAlias() method that returns a boolean with the getType() method that returns the new Type enum.
  • Moved getWriteIndex() up from the IndexAbstraction.Alias to the IndexAbstraction interface.
  • Moved getAliasName() up from the IndexAbstraction.Alias to the IndexAbstraction interface and renamed it to getName().
  • Removed unnecessary casting to IndexAbstraction.Alias by just checking the getType() method.

Relates to #53100

In order to prepare the `AliasOrIndex` abstraction for the introduction of data streams,
the abstraction needs to be made more flexible, because currently it really can be only
an alias or an index.

* Renamed `AliasOrIndex` to `IndexAbstraction`.
* Introduced a `IndexAbstraction.Type` enum to indicate what a `IndexAbstraction` instance is.
* Replaced the `isAlias()` method that returns a boolean with the `getType()` method that returns the new Type enum.
* Moved `getWriteIndex()` up from the `IndexAbstraction.Alias` to the `IndexAbstraction` interface.
* Moved `getAliasName()` up from the `IndexAbstraction.Alias` to the `IndexAbstraction` interface and renamed it to `getName()`.
* Removed unnecessary casting to `IndexAbstraction.Alias` by just checking the `getType()` method.

Relates to elastic#53100
@martijnvg martijnvg added :Data Management/Indices APIs APIs to create and manage indices and templates backport v7.8.0 labels Mar 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@martijnvg martijnvg merged commit 4b4fbc1 into elastic:7.x Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Data Management/Indices APIs APIs to create and manage indices and templates v7.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants