diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-30 12:54:16 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-30 12:54:16 +0100 |
commit | df911518ccf3430af062954bb6ff559306b51371 (patch) | |
tree | acc609bfb0bf71a19cbb390449ed744974b8e855 /searchcore | |
parent | 376d8fdbf792bd08690b07897a3ff43eba473792 (diff) |
Clean up some unused code.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 29 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.h | 66 |
2 files changed, 27 insertions, 68 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 83d3e98d99f..aa1c8483c8d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -496,28 +496,13 @@ Proton::getStatusReports() const { StatusReport::List reports; std::shared_lock<std::shared_timed_mutex> guard(_mutex); - reports.push_back(StatusReport::SP(_matchEngine-> - reportStatus().release())); + reports.push_back(StatusReport::SP(_matchEngine->reportStatus())); for (const auto &kv : _documentDBMap) { - reports.push_back(StatusReport::SP(kv.second-> - reportStatus().release())); + reports.push_back(StatusReport::SP(kv.second->reportStatus())); } return reports; } - -DocumentDB::SP -Proton::getDocumentDB(const document::DocumentType &docType) -{ - std::shared_lock<std::shared_timed_mutex> guard(_mutex); - DocTypeName docTypeName(docType.getName()); - DocumentDBMap::iterator it = _documentDBMap.find(docTypeName); - if (it != _documentDBMap.end()) { - return it->second; - } - return DocumentDB::SP(); -} - DocumentDB::SP Proton::addDocumentDB(const document::DocumentType &docType, document::BucketSpace bucketSpace, @@ -536,17 +521,15 @@ Proton::addDocumentDB(const document::DocumentType &docType, vespalib::string db_dir = config.basedir + "/documents/" + docTypeName.toString(); vespalib::mkdir(db_dir, false); // Assume parent is created. - ConfigStore::UP config_store( - new FileConfigManager(db_dir + "/config", - documentDBConfig->getConfigId(), - docTypeName.getName())); + auto config_store = std::make_unique<FileConfigManager>(db_dir + "/config", + documentDBConfig->getConfigId(), + docTypeName.getName()); config_store->setProtonConfig(bootstrapConfig->getProtonConfigSP()); if (!initializeThreads) { // If configured value for initialize threads was 0, or we // are performing a reconfig after startup has completed, then use // 1 thread per document type. - initializeThreads = std::make_shared<vespalib::ThreadStackExecutor> - (1, 128 * 1024); + initializeThreads = std::make_shared<vespalib::ThreadStackExecutor>(1, 128 * 1024); } DocumentDB::SP ret(new DocumentDB(config.basedir + "/documents", documentDBConfig, diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.h b/searchcore/src/vespa/searchcore/proton/server/proton.h index 5338e450fe5..532c6651cfa 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.h +++ b/searchcore/src/vespa/searchcore/proton/server/proton.h @@ -57,10 +57,9 @@ private: typedef search::engine::MonitorClient MonitorClient; typedef std::map<DocTypeName, DocumentDB::SP> DocumentDBMap; typedef BootstrapConfig::ProtonConfigSP ProtonConfigSP; - typedef std::shared_ptr<FastOS_DynamicLibrary> DynamicLibrarySP; - typedef std::map<vespalib::string, DynamicLibrarySP> LibraryMap; using InitializeThreads = std::shared_ptr<vespalib::ThreadStackExecutorBase>; using lock_guard = std::lock_guard<std::mutex>; + using BucketSpace = document::BucketSpace; struct MetricsUpdateHook : metrics::UpdateHook { @@ -130,17 +129,15 @@ private: std::unique_ptr<HwInfoSampler> _hwInfoSampler; std::shared_ptr<IDocumentDBReferenceRegistry> _documentDBReferenceRegistry; - virtual IDocumentDBConfigOwner *addDocumentDB(const DocTypeName & docTypeName, - document::BucketSpace bucketSpace, - const vespalib::string & configid, - const BootstrapConfig::SP & bootstrapConfig, - const std::shared_ptr<DocumentDBConfig> &documentDBConfig, - InitializeThreads initializeThreads) override; + IDocumentDBConfigOwner * + addDocumentDB(const DocTypeName & docTypeName, BucketSpace bucketSpace, const vespalib::string & configid, + const BootstrapConfig::SP & bootstrapConfig, const std::shared_ptr<DocumentDBConfig> &documentDBConfig, + InitializeThreads initializeThreads) override; - virtual void removeDocumentDB(const DocTypeName &docTypeName) override; + void removeDocumentDB(const DocTypeName &docTypeName) override; - virtual void applyConfig(const BootstrapConfig::SP & configSnapshot) override; - virtual MonitorReply::UP ping(MonitorRequest::UP request, MonitorClient &client) override; + void applyConfig(const BootstrapConfig::SP & configSnapshot) override; + MonitorReply::UP ping(MonitorRequest::UP request, MonitorClient &client) override; /** * Called by the metrics update hook (typically in the context of @@ -148,14 +145,11 @@ private: * threads at once. **/ void updateMetrics(const vespalib::MonitorGuard &guard); - void waitForInitDone(); void waitForOnlineState(); uint32_t getDistributionKey() const override { return _distributionKey; } BootstrapConfig::SP getActiveConfigSnapshot() const; - virtual std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override; - - + std::shared_ptr<IDocumentDBReferenceRegistry> getDocumentDBReferenceRegistry() const override; public: typedef std::unique_ptr<Proton> UP; typedef std::shared_ptr<Proton> SP; @@ -163,7 +157,7 @@ public: Proton(const config::ConfigUri & configUri, const vespalib::string &progName, uint64_t subscribeTimeout); - virtual ~Proton(); + ~Proton() override; /** * This method must be called after the constructor and before the destructor. @@ -174,20 +168,12 @@ public: */ BootstrapConfig::SP init(); - /* - * 2nd phase init: setup data structures. - */ + // 2nd phase init: setup data structures. void init(const BootstrapConfig::SP & configSnapshot); - - DocumentDB::SP getDocumentDB(const document::DocumentType &docType); - DocumentDB::SP - addDocumentDB(const document::DocumentType &docType, - document::BucketSpace bucketSpace, - const BootstrapConfig::SP &configSnapshot, - const std::shared_ptr<DocumentDBConfig> &documentDBConfig, - InitializeThreads initializeThreads); + addDocumentDB(const document::DocumentType &docType, BucketSpace bucketSpace, const BootstrapConfig::SP &configSnapshot, + const std::shared_ptr<DocumentDBConfig> &documentDBConfig, InitializeThreads initializeThreads); metrics::MetricManager & getMetricManager() { return _metricsEngine->getManager(); } FastOS_ThreadPool & getThreadPool() { return _threadPool; } @@ -195,15 +181,10 @@ public: bool triggerFlush(); bool prepareRestart(); - // implements ComponentConfigProducer interface - virtual void getComponentConfig(Consumer &consumer) override; - - // implements IPersistenceEngineOwner interface - virtual void setClusterState(const storage::spi::ClusterState &calc) override; + void getComponentConfig(Consumer &consumer) override; + void setClusterState(const storage::spi::ClusterState &calc) override; - /** - * Return the oldest active config generation used by proton. - */ + // Return the oldest active config generation used by proton. int64_t getConfigGeneration(); size_t getNumDocs() const; @@ -212,24 +193,19 @@ public: vespalib::string getDelayedConfigs() const; - virtual StatusReport::List getStatusReports() const override; + StatusReport::List getStatusReports() const override; MatchEngine & getMatchEngine() { return *_matchEngine; } vespalib::ThreadStackExecutorBase & getExecutor() { return _executor; } - bool isReplayDone() const { return _isReplayDone; } - - virtual bool isInitializing() const override { - return _isInitializing; - } + bool isInitializing() const override { return _isInitializing; } bool hasAbortedInit() const { return _abortInit; } storage::spi::PersistenceProvider & getPersistence() { return *_persistenceEngine; } - // Implements vespalib::StateExplorer - virtual void get_state(const vespalib::slime::Inserter &inserter, bool full) const override; - virtual std::vector<vespalib::string> get_children_names() const override; - virtual std::unique_ptr<vespalib::StateExplorer> get_child(vespalib::stringref name) const override; + void get_state(const vespalib::slime::Inserter &inserter, bool full) const override; + std::vector<vespalib::string> get_children_names() const override; + std::unique_ptr<vespalib::StateExplorer> get_child(vespalib::stringref name) const override; }; } // namespace proton |