diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2017-02-13 08:31:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 08:31:45 +0100 |
commit | 8b3768ff5906ed58d88c7e92d231cc875a280c33 (patch) | |
tree | 076f335cdc9c867fbff8c4bfa8e700e68c8668a0 | |
parent | 7024a70a9c2333622f6a469204611f70a6eefc18 (diff) | |
parent | d3ff1d7cd1523a0e87dc82b0b0dcbc0515b1368c (diff) |
Merge pull request #1708 from yahoo/arnej/followup-review
use documentation comment for expected invariant
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/cluster/Hasher.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/Hasher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/Hasher.java index 0c0da390616..6298c309be7 100644 --- a/container-search/src/main/java/com/yahoo/prelude/cluster/Hasher.java +++ b/container-search/src/main/java/com/yahoo/prelude/cluster/Hasher.java @@ -39,7 +39,6 @@ public class Hasher { } static private VespaBackEndSearcher[] addNode(VespaBackEndSearcher node, VespaBackEndSearcher[] oldNodes) { - assert node != null; for (VespaBackEndSearcher n : oldNodes) { if (n == node) return oldNodes; // already present } @@ -51,6 +50,7 @@ public class Hasher { /** * Make a node available for search. + * @param node the backend searcher (must never be null) */ public void add(VespaBackEndSearcher node) { allNodes = addNode(node, allNodes); @@ -112,7 +112,7 @@ public class Hasher { /** * Return a node, prefer local nodes, try to skip already hit nodes. * - * @param trynum hint to skip already used nodes + * @param trynum hint for skipping (ignored in current implementation) * @return the selected node, or null if this hasher has no nodes */ public VespaBackEndSearcher select(int trynum) { @@ -128,7 +128,6 @@ public class Hasher { if (nodes.length > 1) { idx = Math.abs(avoidAllQrsHitSameTld.incrementAndGet() % nodes.length); } - assert nodes[idx] != null; return nodes[idx]; } |