Skip to content

Introduce isTsdb helpers#152945

Merged
kkrik-es merged 1 commit into
elastic:mainfrom
kkrik-es:isTsdb-refactor
Jul 6, 2026
Merged

Introduce isTsdb helpers#152945
kkrik-es merged 1 commit into
elastic:mainfrom
kkrik-es:isTsdb-refactor

Conversation

@kkrik-es

@kkrik-es kkrik-es commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Pure, no-op refactor: adds IndexMode#isTsdb() and the null-safe static
isTsdb(IndexMode) / isTsdbName(String) helpers, and replaces every
== IndexMode.TIME_SERIES comparison (and equivalent .equals()/switch
checks) across the codebase with a call to one of them.

isTsdb() currently only matches TIME_SERIES, so there is no behavior
change here — just centralizing the check.

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 TIME_SERIES and TSDB.

Test plan

  • Compiles cleanly across all touched modules
  • Existing unit tests for touched files pass unchanged (no test files were modified, since behavior is unchanged)

Related to #152902

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.
@kkrik-es kkrik-es self-assigned this Jul 6, 2026
@kkrik-es kkrik-es requested a review from gmarouli July 6, 2026 09:24
@kkrik-es kkrik-es marked this pull request as ready for review July 6, 2026 09:24
@kkrik-es kkrik-es requested a review from a team as a code owner July 6, 2026 09:24
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@kkrik-es kkrik-es changed the title Introduce IndexMode.isTsdb()/isTsdbName() helpers Introduce isTsdb helpers Jul 6, 2026

@gmarouli gmarouli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kkrik-es kkrik-es enabled auto-merge (squash) July 6, 2026 09:52
@kkrik-es

kkrik-es commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

No worries, we'll see what's missing when I sync #152901 after this is merged.

@kkrik-es kkrik-es merged commit 2daf979 into elastic:main Jul 6, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants