diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-23 22:21:40 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-24 08:57:55 +0200 |
commit | a6d4e2fb601b9367ae25114565751d668434ebdd (patch) | |
tree | d6dea9f37ec18237352e431a3f2369dba4c67a2f /searchcore/src | |
parent | 357044ebbcffa57f763f1ff75f294af09f135d2e (diff) |
Remove the persistence proxy.
Diffstat (limited to 'searchcore/src')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 38 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.h | 7 |
2 files changed, 5 insertions, 40 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 31acf50c421..e5456355f2a 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -151,7 +151,6 @@ Proton::Proton(const config::ConfigUri & configUri, search::engine::MonitorServer(), IDocumentDBOwner(), StatusProducer(), - PersistenceProviderFactory(), IPersistenceEngineOwner(), ComponentConfigProducer(), _configUri(configUri), @@ -162,7 +161,6 @@ Proton::Proton(const config::ConfigUri & configUri, _tls(), _diskMemUsageSampler(), _persistenceEngine(), - _persistenceProxy(), _documentDBMap(), _matchEngine(), _summaryEngine(), @@ -295,13 +293,6 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) _protonConfigurer.applyInitialConfig(initializeThreads); initializeThreads.reset(); - if (_persistenceEngine.get() != NULL) { - _persistenceProxy.reset(new ProviderStub(protonConfig.persistenceprovider.port, - protonConfig.persistenceprovider.threads, - *configSnapshot->getDocumentTypeRepoSP(), - *this)); - } - RPCHooks::Params rpcParams(*this, protonConfig.rpcport, _configUri.getConfigId()); rpcParams.slobrok_config = _configUri.createWithNewId(protonConfig.slobrokconfigid); _rpcHooks.reset(new RPCHooks(rpcParams)); @@ -336,18 +327,6 @@ Proton::getActiveConfigSnapshot() const return _protonConfigurer.getActiveConfigSnapshot()->getBootstrapConfig(); } -storage::spi::PersistenceProvider::UP -Proton::create() const -{ - //TODO : Might be an idea to grab a lock here as this is not - //controlled by you. Must lock with add/remove documentdb or - //reconfig or whatever. - if (_persistenceEngine.get() == NULL) - return storage::spi::PersistenceProvider::UP(); - return storage::spi::PersistenceProvider:: - UP(new PersistenceProviderProxy(*_persistenceEngine)); -} - void Proton::applyConfig(const BootstrapConfig::SP & configSnapshot) { @@ -359,13 +338,8 @@ Proton::applyConfig(const BootstrapConfig::SP & configSnapshot) protonConfig.search.memory.limiter.mincoverage, protonConfig.search.memory.limiter.minhits); const DocumentTypeRepo::SP repo = configSnapshot->getDocumentTypeRepoSP(); - // XXX: This assumes no feeding during reconfig. Otherwise queued messages - // might incorrectly use freed document type repo. - if (_persistenceProxy.get() != NULL) { - _persistenceProxy->setRepo(*repo); - } - _diskMemUsageSampler-> - setConfig(diskMemUsageSamplerConfig(protonConfig)); + + _diskMemUsageSampler->setConfig(diskMemUsageSamplerConfig(protonConfig)); if (_memoryFlushConfigUpdater) { _memoryFlushConfigUpdater->setConfig(protonConfig.flush.memory); _flushEngine->kick(); @@ -383,11 +357,8 @@ Proton::addDocumentDB(const DocTypeName & docTypeName, const DocumentTypeRepo::SP repo = bootstrapConfig->getDocumentTypeRepoSP(); const document::DocumentType *docType = repo->getDocumentType(docTypeName.getName()); if (docType != NULL) { - LOG(info, - "Add document database: " - "doctypename(%s), configid(%s)", - docTypeName.toString().c_str(), - configId.c_str()); + LOG(info, "Add document database: doctypename(%s), configid(%s)", + docTypeName.toString().c_str(), configId.c_str()); return addDocumentDB(*docType, bootstrapConfig, documentDBConfig, initializeThreads).get(); } else { @@ -453,7 +424,6 @@ Proton::~Proton() if (_fs4Server) { _fs4Server->shutDown(); } - _persistenceProxy.reset(); while (!_documentDBMap.empty()) { const DocTypeName docTypeName(_documentDBMap.begin()->first); removeDocumentDB(docTypeName); diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.h b/searchcore/src/vespa/searchcore/proton/server/proton.h index acfba1b428b..701ce284a5c 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.h +++ b/searchcore/src/vespa/searchcore/proton/server/proton.h @@ -12,7 +12,6 @@ #include "proton_configurer.h" #include "rpc_hooks.h" #include "bootstrapconfig.h" -#include <vespa/persistence/proxy/providerstub.h> #include <vespa/searchcore/proton/common/hw_info.h> #include <vespa/searchcore/proton/flushengine/flushengine.h> #include <vespa/searchcore/proton/matchengine/matchengine.h> @@ -46,7 +45,6 @@ class Proton : public IProtonConfigurerOwner, public search::engine::MonitorServer, public IDocumentDBOwner, public StatusProducer, - public storage::spi::ProviderStub::PersistenceProviderFactory, public IPersistenceEngineOwner, public vespalib::ComponentConfigProducer, public vespalib::StateExplorer @@ -57,7 +55,6 @@ private: typedef search::engine::MonitorRequest MonitorRequest; typedef search::engine::MonitorReply MonitorReply; typedef search::engine::MonitorClient MonitorClient; - typedef storage::spi::ProviderStub ProviderStub; typedef std::map<DocTypeName, DocumentDB::SP> DocumentDBMap; typedef BootstrapConfig::ProtonConfigSP ProtonConfigSP; typedef std::shared_ptr<FastOS_DynamicLibrary> DynamicLibrarySP; @@ -106,8 +103,7 @@ private: TLS::UP _tls; std::unique_ptr<DiskMemUsageSampler> _diskMemUsageSampler; PersistenceEngine::UP _persistenceEngine; - ProviderStub::UP _persistenceProxy; - DocumentDBMap _documentDBMap; + DocumentDBMap _documentDBMap; MatchEngine::UP _matchEngine; SummaryEngine::UP _summaryEngine; DocsumBySlime::UP _docsumBySlime; @@ -161,7 +157,6 @@ private: void waitForInitDone(); void waitForOnlineState(); - virtual storage::spi::PersistenceProvider::UP create() const override; uint32_t getDistributionKey() const override { return _distributionKey; } BootstrapConfig::SP getActiveConfigSnapshot() const; virtual std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override; |