Conversation
already documented in the body of the javadoc.
|
Class by Class description of the changes. KllItemsSketch
Partitioner
ItemsSketch
GenericPartitionBoundaries
GenericSortedView
ItemsSketchSortedView
PartitionBoundaries
PartitioningFeature
QuantilesGenericAPI
SketchPartitionLimits
/TEST/... ItemsSketchTest
CrossCheckQuantilesTest
PartitionBoundariesTest
|
jmalkin
left a comment
There was a problem hiding this comment.
I'm not going to block this, but I'm not sure if we fully test both success and failure of the new things? It's possible some of it is implicitly tested via existing code making that a non-issue. But if not, we should fix that before merging.
| public interface SketchPartitionLimits { | ||
|
|
||
| /** | ||
| * Gets the maximum number of partitions this sketch will support based on the configured size <i>K</i> |
There was a problem hiding this comment.
This doesn't seem to use the value of k anywhere? I guess it's implicit in getNumRetained()?
There was a problem hiding this comment.
The comment was about the documentation saying it uses k when the method does not actually do so explicitly (k will impact the number retained outside of exact mode, though, so it's an implicit dependence).
|
|
||
| if (numEquallySized > maxParts) { | ||
| final long partSizeItems = getMinPartitionSizeItems(); | ||
| if (nominalPartitionSize < partSizeItems) { |
There was a problem hiding this comment.
i think this would read a little more clearly if we rename partSizeItems to minPartSizeItems
| + "Retained Items / 2: " + (svLen / 2)); | ||
| + " The requested number of partitions is too large for this sketch."); | ||
| } | ||
| final long totalN = this.totalN; |
There was a problem hiding this comment.
totalN doesn't seem to be used for quite a while in case you want to define it closer to where it's actually used. Not a big deal either way.
There was a problem hiding this comment.
Turns out is was already a class member. I didn't need this line.
|
|
||
| println("Min Size Limit: " + sizeLimit); | ||
| @SuppressWarnings("unused") | ||
| GenericPartitionBoundaries<String> gpb = sk.getPartitionBoundariesFromPartSize(sizeLimit - 1); |
There was a problem hiding this comment.
do we ever test this method so that it succeeds rather than throwing?
There was a problem hiding this comment.
I tested it manually, and it passes at sizeLimit and fails at sizeLimit - 1.
I didn't think it was necessary, but I could add a test that passes exactly at sizeLimit.
Same thing goes for the limit on num partitions.
- getMaxPartitions() - getMinPartSizeItems()
| //this should pass | ||
| final int goodNumPartsRequest = sk.getMaxPartitions(); | ||
| println("Good numPartsRequest " + goodNumPartsRequest); | ||
| GenericPartitionBoundaries<String> gpb = sk.getPartitionBoundariesFromNumParts(goodNumPartsRequest); |
Check notice
Code scanning / CodeQL
Unread local variable
| //this should pass | ||
| final long goodPartSizeRequest= sk.getMinPartitionSizeItems(); | ||
| println("Good partSizeRequest " + goodPartSizeRequest); | ||
| GenericPartitionBoundaries<String> gpb = sk.getPartitionBoundariesFromPartSize(goodPartSizeRequest); |
Check notice
Code scanning / CodeQL
Unread local variable
No description provided.