aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-03 21:00:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-03 21:12:48 +0000
commit898e521641f2881136d405d0ceab5530af0f4448 (patch)
treefe3f9a3bb0a8c71912321c1f6d75ad7aad8e1d9d
parentac901be72bd373a6e49f8a8149fd5c71e7eaae39 (diff)
Use correct serial number when creating attribute.
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp9
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h2
7 files changed, 13 insertions, 17 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
index f81644c3f55..e40e93a7be2 100644
--- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
@@ -41,7 +41,7 @@ makeDocTypeRepo()
Struct("searchdocument.header"),
Struct("searchdocument.body").
addField("a1", DataType::T_INT));
- return std::unique_ptr<const DocumentTypeRepo>(new DocumentTypeRepo(builder.config()));
+ return std::make_unique<DocumentTypeRepo>(builder.config());
}
struct DocContext
@@ -76,13 +76,12 @@ struct Fixture
_attributeFieldWriter(),
_shared(),
_hwInfo(),
- _mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
- _fileHeader, _attributeFieldWriter, _shared, _hwInfo)),
+ _mgr(std::make_shared<AttributeManager>(TEST_DIR, "test.subdb", TuneFileAttributes(),
+ _fileHeader, _attributeFieldWriter, _shared, _hwInfo)),
_pop(),
_ctx()
{
- _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)},
- CREATE_SERIAL_NUM);
+ _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)}, 0);
_pop = std::make_unique<AttributePopulator>(_mgr, 1, "test", CREATE_SERIAL_NUM);
}
AttributeGuard::UP getAttr() {
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 7d5dbb8ca71..7e4e05f6948 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -1045,10 +1045,9 @@ TEST("requireThatPositionsAreUsed")
endDocument();
dc.put(*exp, 1);
- IDocumentStore & store =
- dc._ddb->getReadySubDB()->getSummaryManager()->getBackingStore();
+ IDocumentStore & store = dc._ddb->getReadySubDB()->getSummaryManager()->getBackingStore();
Document::UP act = store.read(1, *bc._repo);
- EXPECT_TRUE(act.get() != nullptr);
+ EXPECT_TRUE(act);
EXPECT_EQUAL(exp->getType(), act->getType());
DocsumRequest req;
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index a97345bcfbb..b275064c0f2 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -323,7 +323,7 @@ struct MyAttributeWriter : public IAttributeWriter
MyTracer &_tracer;
MyAttributeWriter(MyTracer &tracer);
- ~MyAttributeWriter();
+ ~MyAttributeWriter() override;
std::vector<AttributeVector *>
getWritableAttributes() const override {
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
index 9ede0bda577..5208195a968 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
@@ -65,8 +65,7 @@ AttributePopulator::AttributePopulator(const proton::IAttributeManager::SP &mgr,
AttributePopulator::~AttributePopulator()
{
if (LOG_WOULD_LOG(event)) {
- EventLogger::populateAttributeComplete(getNames(),
- _currSerialNum - _initSerialNum);
+ EventLogger::populateAttributeComplete(getNames(),_currSerialNum - _initSerialNum);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
index eae3329fe5a..a0dbb2e4560 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
@@ -30,13 +30,12 @@ public:
search::SerialNum initSerialNum,
const vespalib::string &subDbName,
search::SerialNum configSerialNum);
- ~AttributePopulator();
+ ~AttributePopulator() override;
const IAttributeWriter &getWriter() const { return _writer; }
- // Implements IReprocessingReader
- virtual void handleExisting(uint32_t lid, const std::shared_ptr<document::Document> &doc) override;
- virtual void done() override;
+ void handleExisting(uint32_t lid, const std::shared_ptr<document::Document> &doc) override;
+ void done() override;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
index 885f577ab4e..2a38f788ca4 100644
--- a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
@@ -27,7 +27,7 @@ DocumentReprocessingHandler::DocumentReprocessingHandler(uint32_t docIdLimit)
_docIdLimit(docIdLimit)
{}
-DocumentReprocessingHandler::~DocumentReprocessingHandler() {}
+DocumentReprocessingHandler::~DocumentReprocessingHandler() = default;
void
DocumentReprocessingHandler::visit(uint32_t lid, const std::shared_ptr<document::Document> &doc)
diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h b/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
index a05fa327082..1624fc0f225 100644
--- a/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
+++ b/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
@@ -14,7 +14,7 @@ struct IReprocessingReader
{
typedef std::shared_ptr<IReprocessingReader> SP;
- virtual ~IReprocessingReader() {}
+ virtual ~IReprocessingReader() = default;
/**
* Handle the given existing document.