-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Make AsyncWaitStep#evaluateCondition take an IndexMetadata instead of Index
#133292
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
Conversation
…d of `Index` This avoids subclasses from having to look up the index metadata themselves, which in turn saves some null-checks.
|
Pinging @elastic/es-data-management (Team:Data Management) |
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.
Pull Request Overview
This PR refactors the AsyncWaitStep#evaluateCondition method to accept an IndexMetadata parameter instead of an Index parameter. This change eliminates the need for subclasses to perform index metadata lookups and associated null-checks, simplifying the implementation.
Key changes:
- Modified the abstract method signature in
AsyncWaitStepto takeIndexMetadatainstead ofIndex - Updated all concrete implementations to use the provided
IndexMetadatadirectly - Updated test files to pass
IndexMetadataobjects to the method calls
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| AsyncWaitStep.java | Changed abstract method signature to accept IndexMetadata parameter |
| IndexLifecycleRunner.java | Updated method call to pass IndexMetadata instead of Index |
| WaitUntilTimeSeriesEndTimePassesStep.java | Removed index metadata lookup and null-check, uses provided parameter |
| WaitUntilReplicateForTimePassesStep.java | Removed index metadata lookup and null-check, uses provided parameter |
| WaitForSnapshotStep.java | Removed index metadata lookup and null-check, uses provided parameter |
| WaitForRolloverReadyStep.java | Updated to use provided IndexMetadata parameter directly |
| WaitForNoFollowersStep.java | Simplified to use IndexMetadata parameter and extract index name |
| WaitForFollowShardTasksStep.java | Removed index metadata lookup, uses provided parameter |
| SegmentCountStep.java | Updated to use IndexMetadata parameter and extract Index when needed |
| Multiple test files | Updated test method calls to pass IndexMetadata objects |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lukewhiting
left a comment
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.
LGTM 👍🏻
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
… instead of `Index` (#133292) (#133300) * Make `AsyncWaitStep#evaluateCondition` take an `IndexMetadata` instead of `Index` (#133292) This avoids subclasses from having to look up the index metadata themselves, which in turn saves some null-checks. (cherry picked from commit b0c4ca4) # Conflicts: # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitUntilReplicateForTimePassesStep.java # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitUntilTimeSeriesEndTimePassesStep.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitUntilReplicateForTimePassesStepTests.java # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitUntilTimeSeriesEndTimePassesStepTests.java # x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java # x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>
This avoids subclasses from having to look up the index metadata themselves, which in turn saves some null-checks.