File tree Expand file tree Collapse file tree
main/java/com/yahoo/sketches/theta
test/java/com/yahoo/sketches/theta Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -231,7 +231,8 @@ public double getLowerBound(final int numStdDev) {
231231
232232 /**
233233 * Returns the maximum number of storage bytes required for a CompactSketch with the given
234- * number of actual entries.
234+ * number of actual entries. Note that this assumes the worse case of the sketch in
235+ * estimation mode, which requires storing theta and count.
235236 * @param numberOfEntries the actual number of entries stored with the CompactSketch.
236237 * @return the maximum number of storage bytes required for a CompactSketch with the given number
237238 * of entries.
Original file line number Diff line number Diff line change @@ -686,6 +686,15 @@ public void checkConstructReconstructFromMemory() {
686686 }
687687 }
688688
689+ @ Test
690+ public void checkNullMemory () {
691+ UpdateSketchBuilder bldr = new UpdateSketchBuilder ();
692+ final UpdateSketch sk = bldr .build ();
693+ for (int i = 0 ; i < 1000 ; i ++) { sk .update (i ); }
694+ final UpdateSketch shared = bldr .buildSharedFromSketch (sk , null );
695+ assertEquals (shared .getRetainedEntries (), 1000 );
696+ assertFalse (shared .hasMemory ());
697+ }
689698
690699 //checks Alex's bug where lgArrLongs > lgNomLongs +1.
691700 @ Test
You can’t perform that action at this time.
0 commit comments