summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-11-25 13:41:56 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2022-11-25 13:41:56 +0100
commitb2dc289bb231800fe241255997052ab38db73965 (patch)
tree3fc31538763f9a87703c515bb3a461dcedab6380 /container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
parent2433bce1d4126c121f691035b0d91efbf3862f33 (diff)
pathIndex should not be part of equals and hashcode.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
index 92a522e9970..09db1be4732 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
@@ -87,7 +87,7 @@ public class Dispatcher extends AbstractComponent {
this.dispatchConfig = dispatchConfig;
rpcResourcePool = new RpcResourcePool(dispatchConfig, nodesConfig);
searchCluster = new SearchCluster(clusterId.stringValue(), dispatchConfig.minActivedocsPercentage(),
- nodesConfig, vipStatus, new RpcPingFactory(rpcResourcePool));
+ toNodes(nodesConfig), vipStatus, new RpcPingFactory(rpcResourcePool));
clusterMonitor = new ClusterMonitor<>(searchCluster, true);
volatileItems = update(null);
initialWarmup(dispatchConfig.warmuptime());
@@ -102,6 +102,7 @@ public class Dispatcher extends AbstractComponent {
this.clusterMonitor = clusterMonitor;
this.volatileItems = update(invokerFactory);
}
+
private VolatileItems update(InvokerFactory invokerFactory) {
var items = new VolatileItems(new LoadBalancer(searchCluster.groupList().groups(), toLoadBalancerPolicy(dispatchConfig.distributionPolicy())),
(invokerFactory == null)
@@ -135,6 +136,11 @@ public class Dispatcher extends AbstractComponent {
case LATENCY_AMORTIZED_OVER_TIME: yield LoadBalancer.Policy.LATENCY_AMORTIZED_OVER_TIME;
};
}
+ private static List<Node> toNodes(DispatchNodesConfig nodesConfig) {
+ return nodesConfig.node().stream()
+ .map(n -> new Node(n.key(), n.host(), n.group()))
+ .toList();
+ }
/**
* Will run important code in order to trigger JIT compilation and avoid cold start issues.