aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-05-10 10:44:47 +0200
committerTor Egge <Tor.Egge@online.no>2023-05-10 10:44:47 +0200
commitca7f494815f3149439263526d316333b06cc7720 (patch)
tree0ebc1f024a505a432b38e31e12615e582a2c9a0a /searchcore
parent32cc36e3af0b5e24fdcb27ece4e5920042a8c483 (diff)
Pass transport and file distributor connection spec to SearchEnvironment
in preparation for using RankingAssetsBuilder when handling config in streaming search.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/proton/proton.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp
index 281d7585274..10e49ac0f8e 100644
--- a/searchcore/src/apps/proton/proton.cpp
+++ b/searchcore/src/apps/proton/proton.cpp
@@ -3,6 +3,7 @@
#include <vespa/searchcore/proton/server/proton.h>
#include <vespa/storage/storageserver/storagenode.h>
#include <vespa/metrics/metricmanager.h>
+#include <vespa/searchvisitor/searchvisitor.h>
#include <vespa/vespalib/util/signalhandler.h>
#include <vespa/vespalib/util/programoptions.h>
#include <vespa/vespalib/util/size_literals.h>
@@ -100,12 +101,15 @@ using storage::spi::PersistenceProvider;
#include <vespa/storageserver/app/servicelayerprocess.h>
class ProtonServiceLayerProcess : public storage::ServiceLayerProcess {
- proton::Proton & _proton;
+ proton::Proton& _proton;
+ FNET_Transport& _transport;
+ vespalib::string _file_distributor_connection_spec;
metrics::MetricManager* _metricManager;
public:
ProtonServiceLayerProcess(const config::ConfigUri & configUri,
- proton::Proton & proton);
+ proton::Proton & proton, FNET_Transport& transport,
+ const vespalib::string& file_distributor_connection_spec);
~ProtonServiceLayerProcess() override { shutdown(); }
void shutdown() override;
@@ -121,12 +125,16 @@ public:
_metricManager = &mm;
}
int64_t getGeneration() const override;
+ void add_external_visitors() override;
};
ProtonServiceLayerProcess::ProtonServiceLayerProcess(const config::ConfigUri & configUri,
- proton::Proton & proton)
+ proton::Proton & proton, FNET_Transport& transport,
+ const vespalib::string& file_distributor_connection_spec)
: ServiceLayerProcess(configUri),
_proton(proton),
+ _transport(transport),
+ _file_distributor_connection_spec(file_distributor_connection_spec),
_metricManager(nullptr)
{
setMetricManager(_proton.getMetricManager());
@@ -160,6 +168,12 @@ ProtonServiceLayerProcess::getGeneration() const
return std::min(slGen, protonGen);
}
+void
+ProtonServiceLayerProcess::add_external_visitors()
+{
+ _externalVisitors["searchvisitor"] = std::make_shared<streaming::SearchVisitorFactory>(_configUri, _transport, _file_distributor_connection_spec);
+}
+
namespace {
class ExitOnSignal {
@@ -244,11 +258,13 @@ App::startAndRun(FNET_Transport & transport, int argc, char **argv) {
ExitOnSignal exit_on_signal;
proton.init(configSnapshot);
}
+ vespalib::string file_distributor_connection_spec = configSnapshot->getFiledistributorrpcConfig().connectionspec;
configSnapshot.reset();
std::unique_ptr<ProtonServiceLayerProcess> spiProton;
if ( ! params.serviceidentity.empty()) {
- spiProton = std::make_unique<ProtonServiceLayerProcess>(identityUri.createWithNewId(params.serviceidentity), proton);
+ spiProton = std::make_unique<ProtonServiceLayerProcess>(identityUri.createWithNewId(params.serviceidentity), proton, transport,
+ file_distributor_connection_spec);
spiProton->setupConfig(subscribeTimeout);
spiProton->createNode();
EV_STARTED("servicelayer");