MCPcopy Create free account
hub / github.com/apache/solr / cardinality

Method cardinality

solr/core/src/java/org/apache/solr/util/hll/HLL.java:545–558  ·  view source on GitHub ↗

Computes the cardinality of the HLL. @return the cardinality of HLL. This will never be negative.

()

Source from the content-addressed store, hash-verified

543 * @return the cardinality of HLL. This will never be negative.
544 */
545 public long cardinality() {
546 switch (type) {
547 case EMPTY:
548 return 0 /*by definition*/;
549 case EXPLICIT:
550 return explicitStorage.size();
551 case SPARSE:
552 return (long) Math.ceil(sparseProbabilisticAlgorithmCardinality());
553 case FULL:
554 return (long) Math.ceil(fullProbabilisticAlgorithmCardinality());
555 default:
556 throw new RuntimeException("Unsupported HLL type " + type);
557 }
558 }
559
560 // ------------------------------------------------------------------------
561 // Cardinality helpers

Callers 15

smallRangeSmokeTestMethod · 0.95
normalRangeSmokeTestMethod · 0.95
largeRangeSmokeTestMethod · 0.95
unionTestMethod · 0.95
clearTestMethod · 0.95
smallRangeSmokeTestMethod · 0.95
normalRangeSmokeTestMethod · 0.95
largeRangeSmokeTestMethod · 0.95
addBasicTestMethod · 0.95
unionTestMethod · 0.95
clearTestMethod · 0.95
randomValuesTestMethod · 0.95

Tested by 15

smallRangeSmokeTestMethod · 0.76
normalRangeSmokeTestMethod · 0.76
largeRangeSmokeTestMethod · 0.76
unionTestMethod · 0.76
clearTestMethod · 0.76
smallRangeSmokeTestMethod · 0.76
normalRangeSmokeTestMethod · 0.76
largeRangeSmokeTestMethod · 0.76
addBasicTestMethod · 0.76
unionTestMethod · 0.76
clearTestMethod · 0.76
randomValuesTestMethod · 0.76