Introduce isTsdb helpers#152945
Merged
Merged
Conversation
Add IndexMode#isTsdb() and the null-safe static isTsdb(IndexMode)/ isTsdbName(String) helpers, then replace every == IndexMode.TIME_SERIES comparison (and equivalent .equals()/switch checks) with a call to one of them. isTsdb() currently only matches TIME_SERIES, so this is a pure no-op refactor with no behavior change. This is prep work to shrink the diff of a follow-up PR that adds a new IndexMode.TSDB constant as a preferred alternative spelling of time_series: once every call site already goes through isTsdb(), that PR only needs to add the enum constant itself and flip isTsdb()'s body to match both.
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
gmarouli
approved these changes
Jul 6, 2026
gmarouli
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I tried to double check all the places where we use the non-static method. I believe they are correctly handled, but I am not 100% sure.
Member
Author
|
No worries, we'll see what's missing when I sync #152901 after this is merged. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Pure, no-op refactor: adds
IndexMode#isTsdb()and the null-safe staticisTsdb(IndexMode)/isTsdbName(String)helpers, and replaces every== IndexMode.TIME_SERIEScomparison (and equivalent.equals()/switchchecks) across the codebase with a call to one of them.
isTsdb()currently only matchesTIME_SERIES, so there is no behaviorchange here — just centralizing the check.
This is prep work to shrink the diff of a follow-up PR that adds a new
IndexMode.TSDBconstant as a preferred alternative spelling oftime_series. Once every call site already goes throughisTsdb(),that PR only needs to add the enum constant itself and flip
isTsdb()'sbody to match both
TIME_SERIESandTSDB.Test plan
Related to #152902