-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ML] Use a new annotations index for future annotations #79006
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
Merged
droberts195
merged 9 commits into
elastic:master
from
droberts195:new_annotations_index_template
Oct 14, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d3e6114
[ML] Use a new annotations index for future annotations
33aea17
Merge branch 'master' into new_annotations_index_template
7e22e9a
Merge branch 'master' into new_annotations_index_template
elasticmachine 2d9cb57
Merge branch 'new_annotations_index_template' of github.com:droberts1…
97363c8
Allow for multiple old indices
b4e6fe5
Fix BWC test
d49427c
Merge branch 'master' into new_annotations_index_template
da3ca49
Merge branch 'master' into new_annotations_index_template
40e59fd
Add a test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,7 @@ | |
| import java.util.function.Consumer; | ||
|
|
||
| import static org.elasticsearch.action.support.master.MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT; | ||
| import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_INDEX_HIDDEN; | ||
| import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; | ||
| import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; | ||
| import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_VERSION_CREATED; | ||
|
|
@@ -184,21 +185,23 @@ public void setup() throws Exception { | |
| Settings.builder() | ||
| .put(SETTING_NUMBER_OF_SHARDS, 1) | ||
| .put(SETTING_NUMBER_OF_REPLICAS, 0) | ||
| .put(SETTING_INDEX_HIDDEN, true) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just making the unit test code reflect production more accurately. It wasn't a bug end users would have seen. Same with the tweaks below. |
||
| .put(SETTING_VERSION_CREATED, Version.CURRENT) | ||
| .build()) | ||
| .putAlias(AliasMetadata.builder(AnomalyDetectorsIndex.jobStateIndexWriteAlias()).build()) | ||
| .putAlias(AliasMetadata.builder(AnomalyDetectorsIndex.jobStateIndexWriteAlias()).isHidden(true).build()) | ||
| .build()) | ||
| .fPut( | ||
| AnnotationIndex.INDEX_NAME, | ||
| IndexMetadata.builder(AnnotationIndex.INDEX_NAME) | ||
| AnnotationIndex.LATEST_INDEX_NAME, | ||
| IndexMetadata.builder(AnnotationIndex.LATEST_INDEX_NAME) | ||
| .settings( | ||
| Settings.builder() | ||
| .put(SETTING_NUMBER_OF_SHARDS, 1) | ||
| .put(SETTING_NUMBER_OF_REPLICAS, 0) | ||
| .put(SETTING_INDEX_HIDDEN, true) | ||
| .put(SETTING_VERSION_CREATED, Version.CURRENT) | ||
| .build()) | ||
| .putAlias(AliasMetadata.builder(AnnotationIndex.READ_ALIAS_NAME).build()) | ||
| .putAlias(AliasMetadata.builder(AnnotationIndex.WRITE_ALIAS_NAME).build()) | ||
| .putAlias(AliasMetadata.builder(AnnotationIndex.READ_ALIAS_NAME).isHidden(true).build()) | ||
| .putAlias(AliasMetadata.builder(AnnotationIndex.WRITE_ALIAS_NAME).isHidden(true).build()) | ||
| .build()) | ||
| .build()) | ||
| .build(); | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use a template to create the annotations index, so this should not be needed.