summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests/proton/documentdb')
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp9
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp9
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp13
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_common.h10
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_handler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h4
-rw-r--r--searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp6
8 files changed, 29 insertions, 26 deletions
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index e84c1af3a0c..7394ef1214c 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -30,8 +30,8 @@
#include <vespa/searchcore/proton/test/thread_utils.h>
#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchlib/attribute/interlock.h>
-#include <vespa/searchlib/index/empty_doc_builder.h>
#include <vespa/searchlib/test/directory_handler.h>
+#include <vespa/searchlib/test/doc_builder.h>
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/config-bucketspaces.h>
#include <vespa/config/subscription/sourcespec.h>
@@ -63,6 +63,7 @@ using proton::bucketdb::IBucketDBHandler;
using proton::bucketdb::IBucketDBHandlerInitializer;
using vespalib::IDestructorCallback;
using search::test::DirectoryHandler;
+using search::test::DocBuilder;
using searchcorespi::IFlushTarget;
using searchcorespi::index::IThreadingService;
using storage::spi::Timestamp;
@@ -261,7 +262,7 @@ struct TwoAttrSchema : public OneAttrSchema
}
};
-EmptyDocBuilder::AddFieldsType
+DocBuilder::AddFieldsType
get_add_fields(bool has_attr2)
{
return [has_attr2](auto& header) {
@@ -276,7 +277,7 @@ struct MyConfigSnapshot
{
typedef std::unique_ptr<MyConfigSnapshot> UP;
Schema _schema;
- EmptyDocBuilder _builder;
+ DocBuilder _builder;
DocumentDBConfig::SP _cfg;
BootstrapConfig::SP _bootstrap;
MyConfigSnapshot(FNET_Transport & transport, const Schema &schema, const vespalib::string &cfgDir)
@@ -760,7 +761,7 @@ template <typename FixtureType>
struct DocumentHandler
{
FixtureType &_f;
- EmptyDocBuilder _builder;
+ DocBuilder _builder;
DocumentHandler(FixtureType &f) : _f(f), _builder(get_add_fields(f._baseSchema.getNumAttributeFields() > 1)) {}
static constexpr uint32_t BUCKET_USED_BITS = 8;
static DocumentId createDocId(uint32_t docId)
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 4fc38992368..abd3fba65fd 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -33,8 +33,8 @@
#include <vespa/searchcore/proton/server/ireplayconfig.h>
#include <vespa/searchcore/proton/test/dummy_feed_view.h>
#include <vespa/searchcore/proton/test/transport_helper.h>
-#include <vespa/searchlib/index/empty_doc_builder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
+#include <vespa/searchlib/test/doc_builder.h>
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/lambdatask.h>
@@ -59,6 +59,7 @@ using search::SerialNum;
using search::index::schema::CollectionType;
using search::index::schema::DataType;
using vespalib::makeLambdaTask;
+using search::test::DocBuilder;
using search::transactionlog::TransLogServer;
using search::transactionlog::DomainConfig;
using storage::spi::RemoveResult;
@@ -276,7 +277,7 @@ MyFeedView::~MyFeedView() = default;
struct SchemaContext {
Schema::SP schema;
- EmptyDocBuilder builder;
+ DocBuilder builder;
SchemaContext();
SchemaContext(bool has_i2);
~SchemaContext();
@@ -320,7 +321,7 @@ SchemaContext::addField(vespalib::stringref fieldName)
struct DocumentContext {
Document::SP doc;
BucketId bucketId;
- DocumentContext(const vespalib::string &docId, EmptyDocBuilder &builder) :
+ DocumentContext(const vespalib::string &docId, DocBuilder &builder) :
doc(builder.make_document(docId)),
bucketId(BucketFactory::getBucketId(doc->getId()))
{
@@ -340,7 +341,7 @@ TensorDataType tensor1DType(ValueType::from_spec("tensor(x{})"));
struct UpdateContext {
DocumentUpdate::SP update;
BucketId bucketId;
- UpdateContext(const vespalib::string &docId, EmptyDocBuilder &builder) :
+ UpdateContext(const vespalib::string &docId, DocBuilder &builder) :
update(std::make_shared<DocumentUpdate>(builder.get_repo(), builder.get_document_type(), DocumentId(docId))),
bucketId(BucketFactory::getBucketId(update->getId()))
{
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index d0b7b03c3ab..5758e69dea4 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -26,7 +26,7 @@
#include <vespa/searchcore/proton/test/threading_service_observer.h>
#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchlib/attribute/attributefactory.h>
-#include <vespa/searchlib/index/empty_doc_builder.h>
+#include <vespa/searchlib/test/doc_builder.h>
#include <vespa/searchcommon/attribute/config.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -49,6 +49,7 @@ using vespalib::GateCallback;
using search::SearchableStats;
using search::index::schema::CollectionType;
using search::index::schema::DataType;
+using search::test::DocBuilder;
using searchcorespi::IndexSearchable;
using storage::spi::BucketChecksum;
using storage::spi::BucketInfo;
@@ -436,7 +437,7 @@ MyTransport::~MyTransport() = default;
struct SchemaContext
{
Schema::SP _schema;
- EmptyDocBuilder _builder;
+ DocBuilder _builder;
SchemaContext();
~SchemaContext();
std::shared_ptr<const document::DocumentTypeRepo> getRepo() const { return _builder.get_repo_sp(); }
@@ -466,16 +467,16 @@ struct DocumentContext
BucketId bid;
Timestamp ts;
typedef std::vector<DocumentContext> List;
- DocumentContext(const vespalib::string &docId, uint64_t timestamp, EmptyDocBuilder &builder);
+ DocumentContext(const vespalib::string &docId, uint64_t timestamp, DocBuilder &builder);
~DocumentContext();
- void addFieldUpdate(EmptyDocBuilder &builder, const vespalib::string &fieldName) {
+ void addFieldUpdate(DocBuilder &builder, const vespalib::string &fieldName) {
const document::Field &field = builder.get_document_type().getField(fieldName);
upd->addUpdate(document::FieldUpdate(field));
}
document::GlobalId gid() const { return doc->getId().getGlobalId(); }
};
-DocumentContext::DocumentContext(const vespalib::string &docId, uint64_t timestamp, EmptyDocBuilder& builder)
+DocumentContext::DocumentContext(const vespalib::string &docId, uint64_t timestamp, DocBuilder& builder)
: doc(builder.make_document(docId)),
upd(std::make_shared<DocumentUpdate>(builder.get_repo(), builder.get_document_type(), doc->getId())),
bid(BucketFactory::getNumBucketBits(), doc->getId().getGlobalId().convertToBucketId().getRawId()),
@@ -555,7 +556,7 @@ struct FixtureBase
return getMetaStore().getMetaData(doc_.doc->getId().getGlobalId());
}
- EmptyDocBuilder &getBuilder() { return sc._builder; }
+ DocBuilder &getBuilder() { return sc._builder; }
DocumentContext doc(const vespalib::string &docId, uint64_t timestamp) {
return DocumentContext(docId, timestamp, getBuilder());
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 806729a108c..af984cb357e 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
@@ -24,7 +24,7 @@ using document::Document;
using document::DocumentId;
using document::DocumentTypeRepo;
using namespace proton;
-using search::index::EmptyDocBuilder;
+using search::test::DocBuilder;
using namespace search;
using namespace vespalib;
using vespalib::IDestructorCallback;
@@ -63,7 +63,7 @@ struct MyScanIterator : public IDocumentScanIterator {
};
struct MyHandler : public ILidSpaceCompactionHandler {
- EmptyDocBuilder _builder;
+ DocBuilder _builder;
std::vector<LidUsageStats> _stats;
std::vector<LidVector> _lids;
mutable uint32_t _moveFromLid;
@@ -107,14 +107,14 @@ struct MyStorer : public IOperationStorer {
CommitResult startCommit(DoneCallback) override;
};
-struct MyFeedView : public test::DummyFeedView {
+struct MyFeedView : public proton::test::DummyFeedView {
explicit MyFeedView(std::shared_ptr<const DocumentTypeRepo> repo)
- : test::DummyFeedView(std::move(repo))
+ : proton::test::DummyFeedView(std::move(repo))
{
}
};
-struct MyDocumentStore : public test::DummyDocumentStore {
+struct MyDocumentStore : public proton::test::DummyDocumentStore {
Document::SP _readDoc;
mutable uint32_t _readLid;
MyDocumentStore();
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 fd38853dca1..011de4fc298 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 {
- EmptyDocBuilder _docBuilder;
+ DocBuilder _docBuilder;
std::shared_ptr<bucketdb::BucketDBOwner> _bucketDB;
MyDocumentStore _docStore;
MySubDb _subDb;
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
index 8f88d678c0c..b941161cc35 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.cpp
@@ -116,7 +116,7 @@ JobTestBase::compact() {
void
JobTestBase::notifyNodeRetired(bool nodeRetired) {
- test::BucketStateCalculator::SP calc = std::make_shared<test::BucketStateCalculator>();
+ proton::test::BucketStateCalculator::SP calc = std::make_shared<proton::test::BucketStateCalculator>();
calc->setNodeRetired(nodeRetired);
_clusterStateHandler.notifyClusterStateChanged(calc);
}
diff --git a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
index 5875910f4d9..fb4c6d0478a 100644
--- a/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
+++ b/searchcore/src/tests/proton/documentdb/lid_space_compaction/lid_space_jobtest.h
@@ -10,8 +10,8 @@
namespace storage::spi::dummy { class DummyBucketExecutor; }
struct JobTestBase : public ::testing::Test {
vespalib::MonitoredRefCount _refCount;
- test::ClusterStateHandler _clusterStateHandler;
- test::DiskMemUsageNotifier _diskMemUsageNotifier;
+ proton::test::ClusterStateHandler _clusterStateHandler;
+ proton::test::DiskMemUsageNotifier _diskMemUsageNotifier;
std::unique_ptr<storage::spi::dummy::DummyBucketExecutor> _bucketExecutor;
std::unique_ptr<vespalib::SyncableThreadExecutor> _singleExecutor;
std::unique_ptr<searchcorespi::index::ISyncableThreadService> _master;
diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
index 67342df5613..b8f5fd232de 100644
--- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
@@ -14,7 +14,7 @@
#include <vespa/searchcore/proton/test/mock_summary_adapter.h>
#include <vespa/searchcore/proton/test/transport_helper.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
-#include <vespa/searchlib/index/empty_doc_builder.h>
+#include <vespa/searchlib/test/doc_builder.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/testkit/testapp.h>
@@ -33,8 +33,8 @@ using namespace proton;
using search::DocumentIdT;
using vespalib::IDestructorCallback;
using search::SerialNum;
-using search::index::EmptyDocBuilder;
using search::index::Schema;
+using search::test::DocBuilder;
using storage::spi::Timestamp;
using vespalib::make_string;
@@ -60,7 +60,7 @@ public:
};
std::shared_ptr<const DocumentTypeRepo> myGetDocumentTypeRepo() {
- EmptyDocBuilder builder;
+ DocBuilder builder;
std::shared_ptr<const DocumentTypeRepo> repo = builder.get_repo_sp();
ASSERT_TRUE(repo.get());
return repo;