From cb2966358cad00956899d05f27594a1a864d7559 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 23 Sep 2019 14:25:32 +0200 Subject: Remove some more complicated unused code. --- .../resources/configdefinitions/qr-searchers.def | 7 ------ .../com/yahoo/prelude/cluster/ClusterSearcher.java | 25 +++++++--------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/container-core/src/main/resources/configdefinitions/qr-searchers.def b/container-core/src/main/resources/configdefinitions/qr-searchers.def index bb8f80052f1..1e8bd54acc3 100644 --- a/container-core/src/main/resources/configdefinitions/qr-searchers.def +++ b/container-core/src/main/resources/configdefinitions/qr-searchers.def @@ -71,10 +71,3 @@ searchcluster[].indexingmode enum { REALTIME, STREAMING } default=REALTIME ## Storage cluster route to use for search cluster if indexingmode is streaming. searchcluster[].storagecluster.routespec string default="" - -# The available dispatchers on each search cluster -searchcluster[].dispatcher[].host string -searchcluster[].dispatcher[].port int - -# Per dispatcher config-id might be nice to have, remove it until needed. -# searchcluster[].dispatcher[].configid reference diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java index 22af77020eb..b1ade600f8b 100644 --- a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java +++ b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java @@ -107,17 +107,9 @@ public class ClusterSearcher extends Searcher { vipStatus.addToRotation(searcher.getName()); } else { Dispatcher dispatcher = Dispatcher.create(id.stringValue(), dispatchConfig, clusterInfoConfig.nodeCount(), vipStatus, metric); - for (int dispatcherIndex = 0; dispatcherIndex < searchClusterConfig.dispatcher().size(); dispatcherIndex++) { - try { - if ( ! isRemote(searchClusterConfig.dispatcher(dispatcherIndex).host())) { - FastSearcher searcher = searchDispatch(searchClusterIndex, fs4ResourcePool.getServerId(), docSumParams, - documentDbConfig, dispatcher, dispatcherIndex); - addBackendSearcher(searcher); - } - } catch (UnknownHostException e) { - throw new RuntimeException(e); - } - } + FastSearcher searcher = searchDispatch(searchClusterIndex, fs4ResourcePool.getServerId(), docSumParams, documentDbConfig, dispatcher); + addBackendSearcher(searcher); + } if ( server == null ) { throw new IllegalStateException("ClusterSearcher should have backend."); @@ -142,17 +134,16 @@ public class ClusterSearcher extends Searcher { : !host.equals(HostName.getLocalhost()); } - private static ClusterParams makeClusterParams(int searchclusterIndex, int dispatchIndex) { - return new ClusterParams("sc" + searchclusterIndex + ".num" + dispatchIndex); + private static ClusterParams makeClusterParams(int searchclusterIndex) { + return new ClusterParams("sc" + searchclusterIndex + ".num" + 0); } private static FastSearcher searchDispatch(int searchclusterIndex, String serverId, SummaryParameters docSumParams, DocumentdbInfoConfig documentdbInfoConfig, - Dispatcher dispatcher, - int dispatcherIndex) { - ClusterParams clusterParams = makeClusterParams(searchclusterIndex, dispatcherIndex); + Dispatcher dispatcher) { + ClusterParams clusterParams = makeClusterParams(searchclusterIndex); return new FastSearcher(serverId, dispatcher, docSumParams, clusterParams, documentdbInfoConfig); } @@ -164,7 +155,7 @@ public class ClusterSearcher extends Searcher { if (searchClusterConfig.searchdef().size() != 1) { throw new IllegalArgumentException("Search clusters in streaming search shall only contain a single searchdefinition : " + searchClusterConfig.searchdef()); } - ClusterParams clusterParams = makeClusterParams(searchclusterIndex, 0); + ClusterParams clusterParams = makeClusterParams(searchclusterIndex); VdsStreamingSearcher searcher = new VdsStreamingSearcher(); searcher.setSearchClusterConfigId(searchClusterConfig.rankprofiles().configid()); searcher.setDocumentType(searchClusterConfig.searchdef(0)); -- cgit v1.2.3