Skip to content
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

Remove tech debt on Aggregations#getLeafCollector #88230

Merged
merged 4 commits into from
Jul 7, 2022

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Jul 1, 2022

Remove #getLeafCollector(LeafReaderContext, LeafBucketCollector) in favour of #getLeafCollector(LeafReaderContext, LeafBucketCollector, AggregationExecutionContext).

The PR is a non brainer just removing the old method and adding the new parameter to all implementations. See AggregationBase for the removal of the method.

…avour of #getLeafCollector(LeafReaderContext, LeafBucketCollector, AggregationExecutionContext)
@iverase iverase requested a review from nik9000 July 1, 2022 15:01
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 1, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@iverase iverase changed the title REmove tech debt of Aggregations#getLeafCollector Remove tech debt of Aggregations#getLeafCollector Jul 1, 2022
@iverase iverase changed the title Remove tech debt of Aggregations#getLeafCollector Remove tech debt on Aggregations#getLeafCollector Jul 1, 2022
@jpountz
Copy link
Contributor

jpountz commented Jul 4, 2022

Curiosity question: should we also try to remove the LeafReaderContext from the parameter list since AggregationExecutionContext also exposes the LeafReaderContext? Or alternatively, do we really need the LeafReaderContext in AggregationExecutionContext?

@iverase
Copy link
Contributor Author

iverase commented Jul 4, 2022

Both are doable but not sure which one is the right answer. I think everything comes down to another tech debt issue we have in BucketCollector:

This seems much harder to work on as we are trying to remove a method from the interface, effectively making the BucketCollector not a collector.

@nik9000
Copy link
Member

nik9000 commented Jul 5, 2022

BucketCollector not a collector.

We can't really use it as one any more anyway. I vote we remove the super-interface, especially if we can do it in a purely mechanical way.

Personally I'd prefer to have the LeafReaderContext in the AggregationExecutionContext. And if you just need someone with an opinion use mine. But my preference isn't super strong.

@iverase
Copy link
Contributor Author

iverase commented Jul 6, 2022

We can't really use it as one any more anyway. I vote we remove the super-interface, especially if we can do it in a purely mechanical way.

That is my vote as well but unfortunately it cannot be removed in a mechanical way. We relay that is a collector during the query phase and changing it seems a bit of work.

@iverase
Copy link
Contributor Author

iverase commented Jul 6, 2022

I updated the PR so the signature of the method looks like: #getLeafCollector(AggregationExecutionContext, LeafBucketCollector).

@nik9000
Copy link
Member

nik9000 commented Jul 6, 2022

I think it's an improvement!

@iverase
Copy link
Contributor Author

iverase commented Jul 7, 2022

@elasticmachine update branch

@iverase iverase merged commit d1ba276 into elastic:master Jul 7, 2022
@iverase iverase deleted the getLeafCollector branch July 7, 2022 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants