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

Adjust BufferAggregator.get() impls to return copies #7464

Merged
merged 3 commits into from
Apr 13, 2019

Conversation

jon-wei
Copy link
Contributor

@jon-wei jon-wei commented Apr 12, 2019

Fixes #7461

This PR adjusts HllSketchBuildBufferAggregator, DoublesSketchBuildBufferAggregator, and BaseBloomFilterBufferAggregator to return on-heap copies of the aggregator's objects.

@jon-wei jon-wei added the Bug label Apr 12, 2019
@gianm
Copy link
Contributor

gianm commented Apr 12, 2019

It seems like compact() would work on UpdateDoublesSketch.

@jon-wei jon-wei added the WIP label Apr 12, 2019
* <b>Implementations must not change the position, limit or mark of the given buffer</b>
* <b>Implementations must not change the position, limit or mark of the given buffer.</b>
*
* <b>The object returned must not have any references to the given buffer (i.e., make a copy).</b>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd include rationale for this: it's because the object returned by get may live beyond the lifetime of the underlying buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the rationale here.

@gianm gianm added this to the 0.15.0 milestone Apr 12, 2019
@jon-wei jon-wei removed the WIP label Apr 12, 2019
@jon-wei
Copy link
Contributor Author

jon-wei commented Apr 12, 2019

I updated this to use compact() and added a note on mutability of return objects for BufferAggregator.get()

Copy link
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

LGTM

@gianm gianm merged commit 7d9cb69 into apache:master Apr 13, 2019
gianm pushed a commit to implydata/druid-public that referenced this pull request Apr 14, 2019
* Adjust BufferAggregator.get() impls to return copies

* Update BufferAggregator docs, more agg fixes

* Update BufferAggregator get() doc
gianm pushed a commit to implydata/druid-public that referenced this pull request Apr 14, 2019
* Adjust BufferAggregator.get() impls to return copies

* Update BufferAggregator docs, more agg fixes

* Update BufferAggregator get() doc
clintropolis pushed a commit that referenced this pull request Apr 24, 2019
* Adjust BufferAggregator.get() impls to return copies

* Update BufferAggregator docs, more agg fixes

* Update BufferAggregator get() doc
@clintropolis clintropolis modified the milestones: 0.15.0, 0.14.1 Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HLLSketchBuild: Intermittent errors at query time
3 participants