summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-05-09 17:06:26 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-05-09 17:06:26 +0000
commitb32f28cb625afed9f511a89b1ebfdcbb7e782dad (patch)
tree3049b18b40b325a609fb9fb2aa09badf4e549e9a /searchcore
parentab621028c9ae3fb53feabc2729548f1670060b9b (diff)
Simplify to avoid type declarations.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp42
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.h4
2 files changed, 10 insertions, 36 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
index 8c6a3672829..8ea159a334f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.cpp
@@ -11,11 +11,8 @@ using document::GlobalId;
namespace proton {
-DocumentRetrieverBase::DocumentRetrieverBase(
- const DocTypeName &docTypeName,
- const document::DocumentTypeRepo &repo,
- const IDocumentMetaStoreContext &meta_store,
- bool hasFields)
+DocumentRetrieverBase::DocumentRetrieverBase(const DocTypeName &docTypeName, const document::DocumentTypeRepo &repo,
+ const IDocumentMetaStoreContext &meta_store, bool hasFields)
: IDocumentRetriever(),
_docTypeName(docTypeName),
_repo(repo),
@@ -31,35 +28,17 @@ DocumentRetrieverBase::DocumentRetrieverBase(
DocumentRetrieverBase::~DocumentRetrieverBase() = default;
-const document::DocumentTypeRepo &
-DocumentRetrieverBase::getDocumentTypeRepo() const {
- return _repo;
-}
-
void
-DocumentRetrieverBase::getBucketMetaData(
- const storage::spi::Bucket &bucket,
- search::DocumentMetaData::Vector &result) const {
- ReadGuard readGuard = _meta_store.getReadGuard();
- const search::IDocumentMetaStore &meta_store = readGuard->get();
- meta_store.getMetaData(bucket, result);
+DocumentRetrieverBase::getBucketMetaData(const storage::spi::Bucket &bucket,
+ search::DocumentMetaData::Vector &result) const
+{
+ _meta_store.getReadGuard()->get().getMetaData(bucket, result);
}
search::DocumentMetaData
DocumentRetrieverBase::getDocumentMetaData(const DocumentId &id) const {
- const GlobalId &gid = id.getGlobalId();
- ReadGuard readGuard = _meta_store.getReadGuard();
- const search::IDocumentMetaStore &meta_store = readGuard->get();
- return meta_store.getMetaData(gid);
-}
-
-
-const search::IAttributeManager *
-DocumentRetrieverBase::getAttrMgr() const
-{
- return nullptr;
+ return _meta_store.getReadGuard()->get().getMetaData(id.getGlobalId());
}
-
CachedSelect::SP
DocumentRetrieverBase::parseSelect(const vespalib::string &selection) const
@@ -72,12 +51,7 @@ DocumentRetrieverBase::parseSelect(const vespalib::string &selection) const
auto nselect = std::make_shared<CachedSelect>();
- nselect->set(selection,
- _docTypeName.getName(),
- *_emptyDoc,
- getDocumentTypeRepo(),
- getAttrMgr(),
- _hasFields);
+ nselect->set(selection, _docTypeName.getName(), *_emptyDoc, getDocumentTypeRepo(), getAttrMgr(), _hasFields);
std::lock_guard<std::mutex> guard(_lock);
if (_selectCache.hasKey(selection))
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.h b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.h
index 0ef46b7fb93..bbf43d05e1f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentretrieverbase.h
@@ -25,7 +25,7 @@ class DocumentRetrieverBase : public IDocumentRetriever
const bool _hasFields;
protected:
- virtual const search::IAttributeManager * getAttrMgr() const;
+ virtual const search::IAttributeManager * getAttrMgr() const { return nullptr; }
const document::DocumentType & getDocumentType() const {
return _emptyDoc->getType();
}
@@ -36,7 +36,7 @@ public:
bool hasFields);
~DocumentRetrieverBase() override;
- const document::DocumentTypeRepo &getDocumentTypeRepo() const override;
+ const document::DocumentTypeRepo &getDocumentTypeRepo() const override { return _repo; }
void getBucketMetaData(const storage::spi::Bucket &bucket, search::DocumentMetaData::Vector &result) const override;
search::DocumentMetaData getDocumentMetaData(const document::DocumentId &id) const override;
CachedSelect::SP parseSelect(const vespalib::string &selection) const override;