diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-07-07 20:29:10 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-07-07 20:29:10 +0200 |
commit | 60190eac226a1650387f29269399e51c9efc81fd (patch) | |
tree | 272c987a49a5533211d3b291c5a8e2a8592fc51f /searchcore | |
parent | 17f497e0b727415ff92d309073c784bceb7597d7 (diff) |
Let SearchableDocumentRetriever extend FastAccessDocumentRetriever.
Diffstat (limited to 'searchcore')
7 files changed, 22 insertions, 51 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt index dbcdd8e2039..6582df2f9d3 100644 --- a/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/server/CMakeLists.txt @@ -81,7 +81,6 @@ vespa_add_library(searchcore_server STATIC sample_attribute_usage_job.cpp schema_config_validator.cpp searchable_doc_subdb_configurer.cpp - searchable_document_retriever.cpp searchable_feed_view.cpp searchabledocsubdb.cpp searchcontext.cpp diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp index a95794742e2..cb8abd1cfd9 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_doc_subdb.cpp @@ -295,7 +295,7 @@ FastAccessDocSubDB::getDocumentRetriever() { FastAccessFeedView::SP feedView = _fastUpdateFeedView.get(); proton::IAttributeManager::SP attrMgr = extractAttributeManager(feedView); - return IDocumentRetriever::UP(new FastAccessDocumentRetriever(feedView, attrMgr, _docIdLimit)); + return IDocumentRetriever::UP(new FastAccessDocumentRetriever(feedView, attrMgr)); } void diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_document_retriever.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_document_retriever.h index 7ff43e20b0d..e1957342e31 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_document_retriever.h +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_document_retriever.h @@ -17,14 +17,11 @@ namespace proton { class FastAccessDocumentRetriever : public DocumentRetriever { private: - FastAccessFeedView::SP _feedView; - IAttributeManager::SP _attrMgr; - const DocIdLimit &_docIdLimit; + FastAccessFeedView::SP _feedView; + IAttributeManager::SP _attrMgr; public: - FastAccessDocumentRetriever(const FastAccessFeedView::SP &feedView, - const IAttributeManager::SP &attrMgr, - const DocIdLimit & docIdLimit) + FastAccessDocumentRetriever(const FastAccessFeedView::SP &feedView, const IAttributeManager::SP &attrMgr) : DocumentRetriever(feedView->getPersistentParams()._docTypeName, *feedView->getDocumentTypeRepo(), *feedView->getSchema(), @@ -32,11 +29,9 @@ public: *attrMgr, feedView->getDocumentStore()), _feedView(feedView), - _attrMgr(attrMgr), - _docIdLimit(docIdLimit) - { - } - uint32_t getDocIdLimit() const override { return _docIdLimit.get(); } + _attrMgr(attrMgr) + { } + uint32_t getDocIdLimit() const override { return _feedView->getDocIdLimit().get(); } }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.h b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.h index 338a846942f..3ed6d84ffc3 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.h +++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.h @@ -40,7 +40,7 @@ private: const IAttributeWriter::SP _attributeWriter; DocIdLimit &_docIdLimit; - virtual UpdateScope getUpdateScope(const document::DocumentUpdate &upd); + virtual UpdateScope getUpdateScope(const document::DocumentUpdate &upd) override; virtual void putAttributes(SerialNum serialNum, search::DocumentIdT lid, @@ -52,24 +52,22 @@ private: search::DocumentIdT lid, const document::DocumentUpdate &upd, bool immediateCommit, - OnOperationDoneType onWriteDone); + OnOperationDoneType onWriteDone) override; virtual void removeAttributes(SerialNum serialNum, search::DocumentIdT lid, bool immediateCommit, - OnRemoveDoneType onWriteDone); + OnRemoveDoneType onWriteDone) override; virtual void removeAttributes(SerialNum serialNum, const LidVector &lidsToRemove, bool immediateCommit, - OnWriteDoneType onWriteDone); + OnWriteDoneType onWriteDone) override; - virtual void heartBeatAttributes(SerialNum serialNum); + virtual void heartBeatAttributes(SerialNum serialNum) override; protected: - virtual void - forceCommit(SerialNum serialNum, OnForceCommitDoneType onCommitDone) - override; + virtual void forceCommit(SerialNum serialNum, OnForceCommitDoneType onCommitDone) override; public: FastAccessFeedView(const StoreOnlyFeedView::Context &storeOnlyCtx, @@ -84,10 +82,9 @@ public: return _docIdLimit; } - virtual void handleCompactLidSpace(const CompactLidSpaceOperation &op); + virtual void handleCompactLidSpace(const CompactLidSpaceOperation &op) override; - virtual void - sync() override; + virtual void sync() override; bool fastPartialUpdateAttribute(const vespalib::string &fieldName) { search::AttributeVector *attribute = diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.cpp deleted file mode 100644 index 11f103ca7b4..00000000000 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/fastos/fastos.h> -#include "searchable_document_retriever.h" - -namespace proton { - -SearchableDocumentRetriever::SearchableDocumentRetriever( - const SearchableFeedView::SP &fw, const SearchView::SP &sv) - : DocumentRetriever(fw->getPersistentParams()._docTypeName, - *fw->getDocumentTypeRepo(), - *fw->getSchema(), - *sv->getDocumentMetaStore(), - *sv->getAttributeManager(), - fw->getDocumentStore()), - feedView(fw) -{ -} - -} // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.h b/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.h index dd27e549af7..cde180a230d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchable_document_retriever.h @@ -2,17 +2,18 @@ #pragma once -#include "documentretriever.h" +#include "fast_access_document_retriever.h" #include "searchable_feed_view.h" #include "searchview.h" namespace proton { -struct SearchableDocumentRetriever : DocumentRetriever { - SearchableFeedView::SP feedView; - +class SearchableDocumentRetriever : public FastAccessDocumentRetriever { +public: // Assumes the FeedView also ensures that the MatchView stays alive. - SearchableDocumentRetriever(const SearchableFeedView::SP &fw, const SearchView::SP &sv); + SearchableDocumentRetriever(const SearchableFeedView::SP &fw, const SearchView::SP &sv) : + FastAccessDocumentRetriever(fw, sv->getAttributeManager()) + { } }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp index e2db3bf0d70..83d0436eba1 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp @@ -343,8 +343,7 @@ SearchableDocSubDB::getSearchableStats() const IDocumentRetriever::UP SearchableDocSubDB::getDocumentRetriever() { - return IDocumentRetriever::UP(new SearchableDocumentRetriever( - _rFeedView.get(), _rSearchView.get())); + return IDocumentRetriever::UP(new SearchableDocumentRetriever(_rFeedView.get(), _rSearchView.get())); } MatchingStats |