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

Simplify SiblingPipelineAggregator (#53144) #53341

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 10, 2020

This removes the instanceofs from SiblingPipelineAggregator by
adding a rewriteBuckets method to InternalAggregation that can be
called to, well, rewrite the buckets. The default implementation of
rewriteBuckets throws the same exception that was thrown when you
attempted to run a SiblingPipelineAggregator on an aggregation without
buckets. It is overridden by InternalSingleBucketAggregation and
InternalMultiBucketAggregation to correctly rewrite their buckets.

This removes the `instanceof`s from `SiblingPipelineAggregator` by
adding a `rewriteBuckets` method to `InternalAggregation` that can be
called to, well, rewrite the buckets. The default implementation of
`rewriteBuckets` throws the same exception that was thrown when you
attempted to run a `SiblingPipelineAggregator` on an aggregation without
buckets. It is overridden by `InternalSingleBucketAggregation` and
`InternalMultiBucketAggregation` to correctly rewrite their buckets.
@nik9000 nik9000 merged commit 5ce6de2 into elastic:7.x Mar 10, 2020
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.

1 participant