summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/vespa/document/datatype/datatype.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp35
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummy_document_store.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h2
-rw-r--r--searchlib/src/vespa/searchlib/index/uri_field.cpp3
5 files changed, 24 insertions, 20 deletions
diff --git a/document/src/vespa/document/datatype/datatype.cpp b/document/src/vespa/document/datatype/datatype.cpp
index 3cc7034e336..7d53679bc28 100644
--- a/document/src/vespa/document/datatype/datatype.cpp
+++ b/document/src/vespa/document/datatype/datatype.cpp
@@ -155,7 +155,7 @@ DataType::buildFieldPath(FieldPath & path, vespalib::stringref remainFieldName)
{
if ( !remainFieldName.empty() ) {
path.reserve(4); // Optimize for short paths
- onBuildFieldPath(path,remainFieldName);
+ onBuildFieldPath(path, remainFieldName);
}
}
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index b326db47b5c..2957a2a015d 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -143,7 +143,7 @@ struct MyIndexWriter : public test::MockIndexWriter
uint32_t _wantedLidLimit;
MyTracer &_tracer;
MyIndexWriter(MyTracer &tracer)
- : test::MockIndexWriter(IIndexManager::SP(new test::MockIndexManager())),
+ : test::MockIndexWriter(std::make_shared<test::MockIndexManager>()),
_removes(),
_heartBeatCount(0),
_commitCount(0),
@@ -224,7 +224,7 @@ struct MyDocumentStore : public test::DummyDocumentStore
DocMap _docs;
uint64_t _lastSyncToken;
uint32_t _compactLidSpaceLidLimit;
- MyDocumentStore(const document::DocumentTypeRepo & repo)
+ MyDocumentStore(const document::DocumentTypeRepo & repo) noexcept
: test::DummyDocumentStore("."),
_repo(repo),
_docs(),
@@ -266,42 +266,47 @@ MyDocumentStore::~MyDocumentStore() = default;
struct MySummaryManager : public test::DummySummaryManager
{
MyDocumentStore _store;
- MySummaryManager(const document::DocumentTypeRepo & repo) : _store(repo) {}
- virtual search::IDocumentStore &getBackingStore() override { return _store; }
+ MySummaryManager(const document::DocumentTypeRepo & repo) noexcept : _store(repo) {}
+ ~MySummaryManager() override;
+ search::IDocumentStore &getBackingStore() override { return _store; }
};
+MySummaryManager::~MySummaryManager() = default;
+
struct MySummaryAdapter : public test::MockSummaryAdapter
{
ISummaryManager::SP _sumMgr;
MyDocumentStore &_store;
MyLidVector _removes;
- MySummaryAdapter(const document::DocumentTypeRepo & repo)
- : _sumMgr(new MySummaryManager(repo)),
+ MySummaryAdapter(const document::DocumentTypeRepo & repo) noexcept
+ : _sumMgr(std::make_shared<MySummaryManager>(repo)),
_store(static_cast<MyDocumentStore &>(_sumMgr->getBackingStore())),
_removes()
{}
- virtual void put(SerialNum serialNum, DocumentIdT lid, const Document &doc) override {
+ ~MySummaryAdapter() override;
+ void put(SerialNum serialNum, DocumentIdT lid, const Document &doc) override {
_store.write(serialNum, lid, doc);
}
- virtual void put(SerialNum serialNum, DocumentIdT lid, const vespalib::nbostream & os) override {
+ void put(SerialNum serialNum, DocumentIdT lid, const vespalib::nbostream & os) override {
_store.write(serialNum, lid, os);
}
- virtual void remove(SerialNum serialNum, const DocumentIdT lid) override {
+ void remove(SerialNum serialNum, const DocumentIdT lid) override {
LOG(info, "MySummaryAdapter::remove(): serialNum(%" PRIu64 "), docId(%u)", serialNum, lid);
_store.remove(serialNum, lid);
_removes.push_back(lid);
}
- virtual const search::IDocumentStore &getDocumentStore() const override {
+ const search::IDocumentStore &getDocumentStore() const override {
return _store;
}
- virtual std::unique_ptr<Document> get(const DocumentIdT lid, const DocumentTypeRepo &repo) override {
+ std::unique_ptr<Document> get(const DocumentIdT lid, const DocumentTypeRepo &repo) override {
return _store.read(lid, repo);
}
- virtual void compactLidSpace(uint32_t wantedDocIdLimit) override {
+ void compactLidSpace(uint32_t wantedDocIdLimit) override {
_store.compactLidSpace(wantedDocIdLimit);
}
};
+MySummaryAdapter::~MySummaryAdapter() = default;
struct MyAttributeWriter : public IAttributeWriter
{
@@ -434,7 +439,7 @@ struct SchemaContext
};
SchemaContext::SchemaContext() :
- _schema(new Schema()),
+ _schema(std::make_shared<Schema>()),
_builder()
{
_schema->addIndexField(Schema::IndexField("i1", DataType::STRING, CollectionType::SINGLE));
@@ -442,7 +447,7 @@ SchemaContext::SchemaContext() :
_schema->addAttributeField(Schema::AttributeField("a2", DataType::BOOLEANTREE, CollectionType::SINGLE));
_schema->addAttributeField(Schema::AttributeField("a3", DataType::TENSOR, CollectionType::SINGLE));
_schema->addSummaryField(Schema::SummaryField("s1", DataType::STRING, CollectionType::SINGLE));
- _builder.reset(new DocBuilder(*_schema));
+ _builder = std::make_unique<DocBuilder>(*_schema);
}
SchemaContext::~SchemaContext() = default;
@@ -464,7 +469,7 @@ struct DocumentContext
DocumentContext::DocumentContext(const vespalib::string &docId, uint64_t timestamp, DocBuilder &builder)
: doc(builder.startDocument(docId).startSummaryField("s1").addStr(docId).endField().endDocument().release()),
- upd(new DocumentUpdate(*builder.getDocumentTypeRepo(), builder.getDocumentType(), doc->getId())),
+ upd(std::make_shared<DocumentUpdate>(*builder.getDocumentTypeRepo(), builder.getDocumentType(), doc->getId())),
bid(BucketFactory::getNumBucketBits(), doc->getId().getGlobalId().convertToBucketId().getRawId()),
ts(timestamp)
{}
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_document_store.h b/searchcore/src/vespa/searchcore/proton/test/dummy_document_store.h
index 9e0e8f66dc0..d8d6e119d9b 100644
--- a/searchcore/src/vespa/searchcore/proton/test/dummy_document_store.h
+++ b/searchcore/src/vespa/searchcore/proton/test/dummy_document_store.h
@@ -11,7 +11,7 @@ struct DummyDocumentStore : public search::IDocumentStore
vespalib::string _baseDir;
DummyDocumentStore() = default;
- DummyDocumentStore(const vespalib::string &baseDir)
+ DummyDocumentStore(const vespalib::string &baseDir) noexcept
: _baseDir(baseDir)
{}
~DummyDocumentStore() = default;
diff --git a/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h b/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h
index 4d3513c52f5..f826cbbe921 100644
--- a/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h
+++ b/searchcore/src/vespa/searchcore/proton/test/dummy_summary_manager.h
@@ -9,7 +9,7 @@ namespace test {
struct DummySummaryManager : public ISummaryManager
{
- virtual ISummarySetup::SP
+ ISummarySetup::SP
createSummarySetup(const vespa::config::search::SummaryConfig &,
const vespa::config::search::SummarymapConfig &,
const vespa::config::search::summary::JuniperrcConfig &,
diff --git a/searchlib/src/vespa/searchlib/index/uri_field.cpp b/searchlib/src/vespa/searchlib/index/uri_field.cpp
index 380f67210d3..daf0e6e685e 100644
--- a/searchlib/src/vespa/searchlib/index/uri_field.cpp
+++ b/searchlib/src/vespa/searchlib/index/uri_field.cpp
@@ -78,8 +78,7 @@ UriField::setup(const Schema &schema,
}
void
-UriField::markUsed(UsedFieldsMap &usedFields,
- uint32_t field)
+UriField::markUsed(UsedFieldsMap &usedFields, uint32_t field)
{
if (field == Schema::UNKNOWN_FIELD_ID) {
return;