AlexanderSaydakov commented on code in PR #559:
URL: https://github.com/apache/datasketches-java/pull/559#discussion_r1600807290
##########
src/main/java/org/apache/datasketches/theta/Sketch.java:
##########
@@ -297,13 +297,27 @@ public double getLowerBound(final int numStdDev) {
* @param numberOfEntries the actual number of entries stored with the
CompactSketch.
* @return the maximum number of storage bytes required for a CompactSketch
with the given number
* of entries.
+ * @deprecated as a public method. Use {@link #getCompactSketchMaxBytes(int)
instead}
*/
+ @Deprecated
public static int getMaxCompactSketchBytes(final int numberOfEntries) {
if (numberOfEntries == 0) { return 8; }
if (numberOfEntries == 1) { return 16; }
return (numberOfEntries << 3) + 24;
}
+ /**
+ * Returns the maximum number of storage bytes required for a CompactSketch
given the configured
+ * number of nominal entries (power of 2).
+ * @param nomEntries <a
href="{@docRoot}/resources/dictionary.html#nomEntries">Nominal Entries</a>
+ * @return the maximum number of storage bytes required for a CompactSketch
with the given
+ * nomEntries.
+ */
+ public static int getCompactSketchMaxBytes(final int nomEntries) {
Review Comment:
I don't quite understand why not use getHashTableThreshold() for max
serialized size computation. The size depends exactly on the maximum number of
retained entries in the hash table. Now the knowledge about 2 * K *
rebuild_threshold is sitting in two places
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]