diff options
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/lid_space_compaction')
3 files changed, 14 insertions, 10 deletions
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp index 9c68d7d5974..b3a2e9cad83 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.cpp @@ -127,7 +127,8 @@ MyHandler::handleCompactLidSpace(const CompactLidSpaceOperation &op, std::shared } MyHandler::MyHandler(bool storeMoveDoneContexts, bool bucketIdEqualLid) - : _stats(), + : _builder(), + _stats(), _moveFromLid(0), _moveToLid(0), _handleMoveCnt(0), @@ -140,9 +141,8 @@ MyHandler::MyHandler(bool storeMoveDoneContexts, bool bucketIdEqualLid) _rm_listener(), _docs() { - DocBuilder builder = DocBuilder(Schema()); for (uint32_t i(0); i < 10; i++) { - auto doc = builder.startDocument(fmt("%s%d", DOC_ID.c_str(), i)).endDocument(); + auto doc = _builder.make_document(fmt("%s%d", DOC_ID.c_str(), i)); _docs.emplace_back(DocumentMetaData(i, TIMESTAMP_1, createBucketId(i), doc->getId().getGlobalId()), std::move(doc)); } } diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h index b404fc6956a..806729a108c 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h @@ -17,11 +17,14 @@ #include <vespa/searchcore/proton/test/test.h> #include <vespa/searchcore/proton/test/dummy_document_store.h> #include <vespa/vespalib/util/idestructorcallback.h> -#include <vespa/searchlib/index/docbuilder.h> -using namespace document; +using document::BucketId; +using document::GlobalId; +using document::Document; +using document::DocumentId; +using document::DocumentTypeRepo; using namespace proton; -using namespace search::index; +using search::index::EmptyDocBuilder; using namespace search; using namespace vespalib; using vespalib::IDestructorCallback; @@ -60,6 +63,7 @@ struct MyScanIterator : public IDocumentScanIterator { }; struct MyHandler : public ILidSpaceCompactionHandler { + EmptyDocBuilder _builder; std::vector<LidUsageStats> _stats; std::vector<LidVector> _lids; mutable uint32_t _moveFromLid; diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp index bc9cd9a93fa..fd38853dca1 100644 --- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp @@ -5,7 +5,7 @@ #include <vespa/vespalib/gtest/gtest.h> struct HandlerTest : public ::testing::Test { - DocBuilder _docBuilder; + EmptyDocBuilder _docBuilder; std::shared_ptr<bucketdb::BucketDBOwner> _bucketDB; MyDocumentStore _docStore; MySubDb _subDb; @@ -15,13 +15,13 @@ struct HandlerTest : public ::testing::Test { }; HandlerTest::HandlerTest() - : _docBuilder(Schema()), + : _docBuilder(), _bucketDB(std::make_shared<bucketdb::BucketDBOwner>()), _docStore(), - _subDb(_bucketDB, _docStore, _docBuilder.getDocumentTypeRepo()), + _subDb(_bucketDB, _docStore, _docBuilder.get_repo_sp()), _handler(_subDb.maintenance_sub_db, "test") { - _docStore._readDoc = _docBuilder.startDocument(DOC_ID).endDocument(); + _docStore._readDoc = _docBuilder.make_document(DOC_ID); } HandlerTest::~HandlerTest() = default; |