Skip to content

Conversation

ohadzeliger
Copy link
Contributor

@ohadzeliger ohadzeliger commented Sep 8, 2025

This implementation is creating a flavor of the SizeStatisticsCollectorCursor that can return sizes aggregated by sub-subspaces.
This relies on the original implementation but had to go into a separate class as the generic type of the cursor has changed.
Eventually, the original cursor can be replaced by this one with the aggregation size being "0".
For backwards compatibility, the original class was marked as "deprecated". The original SizeStatisticsResults was marked as deprecated and a new (non-embedded version) of it was added.

Initially, I thought that we can make a backwards-compatible change to the SizeStatisticsCollectorCursor class, but that proved more complicated with the changes to the result type, so I decided to go with a new implementation instead.

Resolves #3576

@ohadzeliger ohadzeliger added the enhancement New feature or request label Sep 9, 2025
@ohadzeliger ohadzeliger marked this pull request as ready for review September 10, 2025 18:24
@ohadzeliger ohadzeliger self-assigned this Sep 11, 2025
- Change lifecycle to allow multiple onNext calls for an instance
- Add boolean marker to continuation
- Static import assertThat
- Supply executor to whileTrue
Copy link
Collaborator

@alecgrieser alecgrieser left a comment

Choose a reason for hiding this comment

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

LGTM. I left a few small things that you could address at your discretion

Comment on lines 80 to 82
// Default to false
return (statsContinuation.hasLastResultContinuation() &&
statsContinuation.getLastResultContinuation());
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't wrong, but getLastResultContinuation() should return false (not, say, null) if the field is unset, so this should be logically equivalent to:

Suggested change
// Default to false
return (statsContinuation.hasLastResultContinuation() &&
statsContinuation.getLastResultContinuation());
// Default to false
return statsContinuation.getLastResultContinuation());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, done.

@ohadzeliger ohadzeliger merged commit 6c0597e into FoundationDB:main Oct 1, 2025
8 checks passed
@ohadzeliger ohadzeliger deleted the size-collector branch October 1, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an aggregate size calculator that can group size by subspace
2 participants