Skip to content

Commit

Permalink
Use pre-parsed index mode when figuring out timestamp range (#88254)
Browse files Browse the repository at this point in the history
Use `indexMode` field instead of parsing IndexMode from settings in
order to determine time series timestamp range. Parsing the index mode
isn't necessary, because we read the index mode when IndexMetadata is
constructed, and this just burns unnecessary CPU cycles.
  • Loading branch information
martijnvg authored Jul 4, 2022
1 parent 06607c3 commit e21c597
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,11 @@ public IndexLongFieldRange getTimestampRange() {
*/
@Nullable
public IndexLongFieldRange getTimeSeriesTimestampRange() {
return IndexSettings.MODE.get(settings).getConfiguredTimestampRange(this);
if (indexMode != null) {
return indexMode.getConfiguredTimestampRange(this);
} else {
return null;
}
}

@Override
Expand Down

0 comments on commit e21c597

Please sign in to comment.