summaryrefslogtreecommitdiffstats
path: root/container-search/src/main
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-09-20 12:06:30 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-09-20 12:06:30 +0200
commitf0475fac6d3c95212b88768b971ebc035d0c3d46 (patch)
treed34e0445ca7d9288cd1bf2d499231aea0f435f78 /container-search/src/main
parent0419474326ad85730a8f8d02caa7e027474ed018 (diff)
Take streaming search up and also add unit test for it.
Diffstat (limited to 'container-search/src/main')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java16
1 files changed, 6 insertions, 10 deletions
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 b0d9c2b0002..37d8e316302 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
@@ -86,8 +86,6 @@ public class ClusterSearcher extends Searcher {
VipStatus vipStatus) {
super(id);
- Dispatcher dispatcher = Dispatcher.create(id.stringValue(), dispatchConfig, clusterInfoConfig.nodeCount(), vipStatus, metric);
-
int searchClusterIndex = clusterConfig.clusterId();
clusterModelName = clusterConfig.clusterName();
QrSearchersConfig.Searchcluster searchClusterConfig = getSearchClusterConfigFromClusterName(qrsConfig, clusterModelName);
@@ -98,8 +96,7 @@ public class ClusterSearcher extends Searcher {
.setLogRaw(false).setLogMean(true));
maxQueryTimeout = ParameterParser.asMilliSeconds(clusterConfig.maxQueryTimeout(), DEFAULT_MAX_QUERY_TIMEOUT);
- maxQueryCacheTimeout = ParameterParser.asMilliSeconds(clusterConfig.maxQueryCacheTimeout(),
- DEFAULT_MAX_QUERY_CACHE_TIMEOUT);
+ maxQueryCacheTimeout = ParameterParser.asMilliSeconds(clusterConfig.maxQueryCacheTimeout(), DEFAULT_MAX_QUERY_CACHE_TIMEOUT);
SummaryParameters docSumParams = new SummaryParameters(qrsConfig
.com().yahoo().prelude().fastsearch().FastSearcher().docsum()
@@ -115,12 +112,12 @@ public class ClusterSearcher extends Searcher {
}
if (searchClusterConfig.indexingmode() == STREAMING) {
- VdsStreamingSearcher searcher = vdsCluster(fs4ResourcePool.getServerId(),
- searchClusterIndex,
- searchClusterConfig, docSumParams,
- documentDbConfig);
+ VdsStreamingSearcher searcher = vdsCluster(fs4ResourcePool.getServerId(), searchClusterIndex,
+ searchClusterConfig, docSumParams, documentDbConfig);
addBackendSearcher(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())) {
@@ -129,13 +126,12 @@ public class ClusterSearcher extends Searcher {
addBackendSearcher(searcher);
}
} catch (UnknownHostException e) {
- e.printStackTrace();
throw new RuntimeException(e);
}
}
}
if ( server == null ) {
- throw new IllegalStateException("ClusterSearcher should have a top level dispatch.");
+ throw new IllegalStateException("ClusterSearcher should have backend.");
}
}