Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ protected InternalCardinality mutateInstance(InternalCardinality instance) {
case 1:
HyperLogLogPlusPlus newState = new HyperLogLogPlusPlus(state.precision(),
new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService()), 0);
newState.merge(0, state, 0);
int extraValues = between(10, 100);
for (int i = 0; i < extraValues; i++) {
for (int i = 0; i < 10; i++) {
newState.collect(0, BitMixer.mix64(randomIntBetween(500, 10000)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't looked closely at the test, but is there a way to ensure we add new values that weren't previously added? Maybe by picking from a different range of random values or something? Or keeping a set?

Maybe it's a non-issue and random enough to not matter... might be a problem for a different day :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does use a different range of values, Still for precision 4 in the previous approach you could get the same sketch at the end :( I think this way is very very unlikely.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah gotcha. Sounds good!

}
algos.add(newState);
Expand Down