summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java
index 3657e0b5c76..dc35ebdc65f 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/searchcluster/SearchCluster.java
@@ -186,17 +186,11 @@ public class SearchCluster implements NodeManager<Node> {
}
/**
- * Returns the nodes of this cluster as an immutable map indexed by host.
- * One host may contain multiple nodes (on different ports), so this is a multi-map.
- */
- public ImmutableMultimap<String, Node> nodesByHost() { return nodesByHost; }
-
- /**
* Returns the recipient we should dispatch queries directly to (bypassing fdispatch),
* or empty if we should not dispatch directly.
*/
public Optional<Node> directDispatchTarget() {
- if ( ! directDispatchTarget.isPresent()) return Optional.empty();
+ if ( directDispatchTarget.isEmpty()) return Optional.empty();
// Only use direct dispatch if the local group has sufficient coverage
Group localSearchGroup = groups.get(directDispatchTarget.get().group());
@@ -240,13 +234,11 @@ public class SearchCluster implements NodeManager<Node> {
}
private boolean usesDirectDispatchTo(Node node) {
- if ( ! directDispatchTarget.isPresent()) return false;
- return directDispatchTarget.get().equals(node);
+ return directDispatchTarget.isPresent() && directDispatchTarget.get().equals(node);
}
private boolean usesDirectDispatchTo(Group group) {
- if ( ! directDispatchTarget.isPresent()) return false;
- return directDispatchTarget.get().group() == group.id();
+ return directDispatchTarget.isPresent() && directDispatchTarget.get().group() == group.id();
}
/** Used by the cluster monitor to manage node status */