diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-15 11:58:29 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-04-15 11:58:29 +0000 |
commit | a4e565c808f7999f561b0dad881f3a34040ab5d7 (patch) | |
tree | a4f30fd3fd32d3d18494b47a61e58f95bfc16fb3 /container-search/src/test/java/com/yahoo/search/dispatch/searchcluster | |
parent | 2cebe16d47872f08472ac52cbfc9e1102fb695da (diff) |
Make SearchCluster.TopKEstimator a top level class.
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/dispatch/searchcluster')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/dispatch/searchcluster/SearchClusterTest.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/searchcluster/SearchClusterTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/searchcluster/SearchClusterTest.java index 840edd3a419..09024150a9a 100644 --- a/container-search/src/test/java/com/yahoo/search/dispatch/searchcluster/SearchClusterTest.java +++ b/container-search/src/test/java/com/yahoo/search/dispatch/searchcluster/SearchClusterTest.java @@ -8,6 +8,7 @@ import com.yahoo.net.HostName; import com.yahoo.prelude.Pong; import com.yahoo.search.cluster.ClusterMonitor; import com.yahoo.search.dispatch.MockSearchCluster; +import com.yahoo.search.dispatch.TopKEstimator; import com.yahoo.search.result.ErrorMessage; import org.junit.Test; @@ -27,7 +28,6 @@ import static org.junit.Assert.assertTrue; * @author baldersheim */ public class SearchClusterTest { - private static final double EPSILON = 0.00000000001; static class State implements AutoCloseable{ @@ -335,15 +335,4 @@ public class SearchClusterTest { assertEquals(3, node.getLastReceivedPongId()); } - @Test - public void requireHitsAreEstimatedAccordingToPartitionsAndProbability() { - SearchCluster.TopKEstimator estimator = new SearchCluster.TopKEstimator(30, 0.999); - assertEquals(91.97368471911312, estimator.estimateExactK(200, 3), EPSILON); - assertEquals(92, estimator.estimateK(200, 3)); - assertEquals(37.96328109101396, estimator.estimateExactK(200, 10), EPSILON); - assertEquals(38, estimator.estimateK(200, 10)); - assertEquals(23.815737601023095, estimator.estimateExactK(200, 20), EPSILON); - assertEquals(24, estimator.estimateK(200, 20)); - } - } |