-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Cache ILM policy name on IndexMetadata #83603
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
joegallo
merged 14 commits into
elastic:master
from
joegallo:hoist-lifecycle-name-setting
Feb 8, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
306e01c
Use policyName more consistently as a variable name
joegallo 6611dc2
Use Setting.timeSetting
joegallo 0241c70
Hoist the ILM lifecycle policy name to IndexMetadata
joegallo ac72446
Mark as nullable, add a test
joegallo 85119a6
Avoid LIFECYCLE_NAME_SETTING.getKey()
joegallo 5b263dc
Update docs/changelog/83603.yaml
joegallo 5b05683
Fix this condition
joegallo d3c96ea
Merge branch 'master' into hoist-lifecycle-name-setting
joegallo 508447c
Add nullable, and some explanations
joegallo efb6eb9
Merge branch 'master' into hoist-lifecycle-name-setting
joegallo 280b43b
More explicit policy name validation
joegallo db05f03
Invert this check
joegallo 343699d
Merge branch 'master' into hoist-lifecycle-name-setting
joegallo d68db24
Merge branch 'master' into hoist-lifecycle-name-setting
joegallo 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 83603 | ||
| summary: Cache ILM policy name on `IndexMetadata` | ||
| area: ILM+SLM | ||
| type: enhancement | ||
| issues: | ||
| - 83582 |
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
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
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 |
|---|---|---|
|
|
@@ -6,19 +6,18 @@ | |
| */ | ||
| package org.elasticsearch.xpack.core.ilm; | ||
|
|
||
| import org.elasticsearch.cluster.metadata.IndexMetadata; | ||
| import org.elasticsearch.common.Strings; | ||
| import org.elasticsearch.common.settings.Setting; | ||
| import org.elasticsearch.core.TimeValue; | ||
| import org.elasticsearch.xpack.core.scheduler.CronSchedule; | ||
|
|
||
| import static org.elasticsearch.common.settings.Setting.timeSetting; | ||
|
|
||
| /** | ||
| * Class encapsulating settings related to Index Lifecycle Management X-Pack Plugin | ||
| */ | ||
| public class LifecycleSettings { | ||
| public static final String LIFECYCLE_POLL_INTERVAL = "indices.lifecycle.poll_interval"; | ||
| public static final String LIFECYCLE_NAME = "index.lifecycle.name"; | ||
| public static final String LIFECYCLE_NAME = IndexMetadata.LIFECYCLE_NAME; | ||
| public static final String LIFECYCLE_INDEXING_COMPLETE = "index.lifecycle.indexing_complete"; | ||
| public static final String LIFECYCLE_ORIGINATION_DATE = "index.lifecycle.origination_date"; | ||
| public static final String LIFECYCLE_PARSE_ORIGINATION_DATE = "index.lifecycle.parse_origination_date"; | ||
|
|
@@ -35,7 +34,7 @@ public class LifecycleSettings { | |
| // already mounted as a searchable snapshot. Those ILM actions will check if the index has this setting name configured. | ||
| public static final String SNAPSHOT_INDEX_NAME = "index.store.snapshot.index_name"; | ||
|
|
||
| public static final Setting<TimeValue> LIFECYCLE_POLL_INTERVAL_SETTING = timeSetting( | ||
| public static final Setting<TimeValue> LIFECYCLE_POLL_INTERVAL_SETTING = Setting.timeSetting( | ||
|
Contributor
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 seems unrelated?
Contributor
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. It's just a cleanup commit. "While I was here", so to speak. |
||
| LIFECYCLE_POLL_INTERVAL, | ||
| TimeValue.timeValueMinutes(10), | ||
| TimeValue.timeValueSeconds(1), | ||
|
|
@@ -81,7 +80,7 @@ public class LifecycleSettings { | |
| // This setting configures how much time since step_time should ILM wait for a condition to be met. After the threshold wait time has | ||
| // elapsed ILM will likely stop waiting and go to the next step. | ||
| // Also see {@link org.elasticsearch.xpack.core.ilm.ClusterStateWaitUntilThresholdStep} | ||
| public static final Setting<TimeValue> LIFECYCLE_STEP_WAIT_TIME_THRESHOLD_SETTING = timeSetting( | ||
| public static final Setting<TimeValue> LIFECYCLE_STEP_WAIT_TIME_THRESHOLD_SETTING = Setting.timeSetting( | ||
| LIFECYCLE_STEP_WAIT_TIME_THRESHOLD, | ||
| TimeValue.timeValueHours(12), | ||
| TimeValue.timeValueHours(1), | ||
|
|
@@ -114,7 +113,7 @@ public class LifecycleSettings { | |
| Setting.Property.Dynamic, | ||
| Setting.Property.NodeScope | ||
| ); | ||
| public static final Setting<TimeValue> SLM_RETENTION_DURATION_SETTING = timeSetting( | ||
| public static final Setting<TimeValue> SLM_RETENTION_DURATION_SETTING = Setting.timeSetting( | ||
| SLM_RETENTION_DURATION, | ||
| TimeValue.timeValueHours(1), | ||
| TimeValue.timeValueMillis(500), | ||
|
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.