Skip to content

MetricsInfoOperator refactoring#142935

Merged
leontyevdv merged 6 commits intoelastic:mainfrom
leontyevdv:refactor/metrics-info-refactoring
Feb 24, 2026
Merged

MetricsInfoOperator refactoring#142935
leontyevdv merged 6 commits intoelastic:mainfrom
leontyevdv:refactor/metrics-info-refactoring

Conversation

@leontyevdv
Copy link
Copy Markdown
Contributor

@leontyevdv leontyevdv commented Feb 24, 2026

  1. Make MetricsInfoOperator's constructors private.
  2. Use scratch instead of creating BytesRef each time we need to read _source in MetricsInfoOperator

Make constructors private. Use scratch instead of creating BytesRef each
 time we need to read _source.
@leontyevdv leontyevdv requested a review from a team February 24, 2026 11:17
@leontyevdv leontyevdv self-assigned this Feb 24, 2026
@leontyevdv leontyevdv added >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL Team:StorageEngine :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL labels Feb 24, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @leontyevdv, I've created a changelog YAML for you.

Make constructors private. Use scratch instead of creating BytesRef each
 time we need to read _source.
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.

Given it doesn't change functionality, should we add >non-issue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, thanks! Added a tag

@sidosera
Copy link
Copy Markdown
Contributor

LGTM. Please take a look at my comment, I think it is safe to tag as >non-issue.

@kkrik-es kkrik-es changed the title MetricsInfoOperator rafctoring MetricsInfoOperator refactoring Feb 24, 2026
}

private MetricsInfoOperator createInitialOperator() {
return (MetricsInfoOperator) new MetricsInfoOperator.Factory(SIMPLE_LOOKUP, METADATA_CHANNEL, INDEX_CHANNEL).get(driverContext());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need the casts, here and below?

Copy link
Copy Markdown
Contributor Author

@leontyevdv leontyevdv Feb 24, 2026

Choose a reason for hiding this comment

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

Yeah, polished this. It required because I used specific (MetricsInfoOperator) types in the client methods, but base class is enough actually. Thanks!

* Creates an INITIAL-mode operator (data nodes).
*/
public MetricsInfoOperator(BlockFactory blockFactory, MetricFieldLookup fieldLookup, int metadataSourceChannel, int indexChannel) {
private MetricsInfoOperator(BlockFactory blockFactory, MetricFieldLookup fieldLookup, int metadataSourceChannel, int indexChannel) {
Copy link
Copy Markdown
Member

@kkrik-es kkrik-es Feb 24, 2026

Choose a reason for hiding this comment

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

You can even keep a single constructor as private, and pass the right combination of args in each factory.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's even better. Polished. Thanks!

Copy link
Copy Markdown
Member

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

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

Some minor comments.

@leontyevdv leontyevdv merged commit c161e5f into elastic:main Feb 24, 2026
35 checks passed
szybia added a commit to szybia/elasticsearch that referenced this pull request Feb 24, 2026
…on-sliced-reindex

* upstream/main:
  Mute org.elasticsearch.reindex.management.ReindexManagementClientYamlTestSuiteIT test {yaml=reindex/30_cancel_reindex/Cancel running reindex returns response and GET confirms completed} elastic#142079
  [ESQL] Fix async logging consistency and severity (elastic#142401)
  more consistent allow_no_indices=false errors (elastic#142373)
  Attribute ES|QL shard search load in Lucene operators (elastic#142841)
  MetricsInfoOperator refactoring (elastic#142935)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >enhancement >non-issue :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants