summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-09 12:24:58 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-08-09 12:24:58 +0000
commitb8d01612189d2627c21f838a756340c610a3f728 (patch)
tree4a44db5bdf600d19cf1f670e0b21833e89a4ffe8 /searchcore
parentf4be22bb9c8dd210e4b4e3ffd7c167751a4c5700 (diff)
Remove the use and testing of legacy groupdoc/userdoc/orderdoc document ids.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp40
-rw-r--r--searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp2
5 files changed, 26 insertions, 27 deletions
diff --git a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
index 677ad0a9883..b16bf6620c2 100644
--- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
@@ -1,6 +1,4 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("buckethandler_test");
#include <vespa/searchcore/proton/server/buckethandler.h>
#include <vespa/searchcore/proton/server/ibucketstatechangedhandler.h>
#include <vespa/searchcore/proton/server/ibucketmodifiedhandler.h>
@@ -8,6 +6,9 @@ LOG_SETUP("buckethandler_test");
#include <vespa/persistence/spi/test.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("buckethandler_test");
+
using namespace proton;
using document::BucketId;
using document::GlobalId;
diff --git a/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp b/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp
index c7c2749e987..ec82ca0637f 100644
--- a/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_scan_iterator/document_scan_iterator_test.cpp
@@ -34,7 +34,7 @@ struct Fixture
return *this;
}
Fixture &add(uint32_t lid) {
- DocumentId docId(make_string("userdoc:test:%u:%u", 1, lid));
+ DocumentId docId(make_string("id:test:test:n=%u:%u", 1, lid));
const GlobalId &gid = docId.getGlobalId();
DMSResult res = _metaStore.inspect(gid);
ASSERT_EQUAL(lid, res._lid);
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index cfc3e4373a1..b39b70572e0 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -133,7 +133,7 @@ ParamsContext::ParamsContext(const vespalib::string &docType, const vespalib::st
{
(void) baseDir;
}
-ParamsContext::~ParamsContext() {}
+ParamsContext::~ParamsContext() = default;
struct MyIndexWriter : public test::MockIndexWriter
{
@@ -150,22 +150,20 @@ struct MyIndexWriter : public test::MockIndexWriter
_wantedLidLimit(0),
_tracer(tracer)
{}
- virtual void put(SerialNum serialNum, const document::Document &doc,
- const DocumentIdT lid) override {
+ void put(SerialNum serialNum, const document::Document &doc, const DocumentIdT lid) override {
(void) doc;
_tracer.tracePut(indexAdapterTypeName, serialNum, lid, false);
}
- virtual void remove(SerialNum serialNum, const search::DocumentIdT lid) override {
- LOG(info, "MyIndexAdapter::remove(): serialNum(%" PRIu64 "), docId(%u)",
- serialNum, lid);
+ void remove(SerialNum serialNum, const search::DocumentIdT lid) override {
+ LOG(info, "MyIndexAdapter::remove(): serialNum(%" PRIu64 "), docId(%u)", serialNum, lid);
_removes.push_back(lid);
_tracer.traceRemove(indexAdapterTypeName, serialNum, lid, false);
}
- virtual void commit(SerialNum serialNum, OnWriteDoneType) override {
+ void commit(SerialNum serialNum, OnWriteDoneType) override {
++_commitCount;
_tracer.traceCommit(indexAdapterTypeName, serialNum);
}
- virtual void heartBeat(SerialNum) override { ++_heartBeatCount; }
+ void heartBeat(SerialNum) override { ++_heartBeatCount; }
void compactLidSpace(SerialNum, uint32_t lidLimit) override {
_wantedLidLimit = lidLimit;
}
@@ -869,13 +867,13 @@ TEST_F("require that update() calls attribute adapter", SearchableFeedViewFixtur
TEST_F("require that remove() updates document meta store with bucket info",
SearchableFeedViewFixture)
{
- DocumentContext dc1 = f.doc("userdoc:test:1:1", 10);
- DocumentContext dc2 = f.doc("userdoc:test:1:2", 11);
+ DocumentContext dc1 = f.doc("id:test:searchdocument:n=1:1", 10);
+ DocumentContext dc2 = f.doc("id:test:searchdocument:n=1:2", 11);
f.putAndWait(dc1);
BucketChecksum bcs1 = f.getBucketDB()->get(dc1.bid).getChecksum();
f.putAndWait(dc2);
BucketChecksum bcs2 = f.getBucketDB()->get(dc2.bid).getChecksum();
- f.removeAndWait(DocumentContext("userdoc:test:1:2", 20, f.getBuilder()));
+ f.removeAndWait(DocumentContext("id:test:searchdocument:n=1:2", 20, f.getBuilder()));
assertBucketInfo(dc1.bid, Timestamp(10), 1, f.getMetaStore());
EXPECT_FALSE(f.getMetaStore().validLid(2)); // don't remember remove
@@ -937,11 +935,11 @@ TEST_F("require that remove() calls removeComplete() via delayed thread service"
TEST_F("require that handleDeleteBucket() removes documents", SearchableFeedViewFixture)
{
DocumentContext::List docs;
- docs.push_back(f.doc("userdoc:test:1:1", 10));
- docs.push_back(f.doc("userdoc:test:1:2", 11));
- docs.push_back(f.doc("userdoc:test:1:3", 12));
- docs.push_back(f.doc("userdoc:test:2:1", 13));
- docs.push_back(f.doc("userdoc:test:2:2", 14));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:1", 10));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:2", 11));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:3", 12));
+ docs.push_back(f.doc("id:test:searchdocument:n=2:1", 13));
+ docs.push_back(f.doc("id:test:searchdocument:n=2:2", 14));
f.putAndWait(docs);
TEST_DO(f.assertChangeHandler(docs.back().gid(), 5u, 5u));
@@ -1005,11 +1003,11 @@ assertPostConditionAfterRemoves(const DocumentContext::List &docs,
TEST_F("require that removes are not remembered", SearchableFeedViewFixture)
{
DocumentContext::List docs;
- docs.push_back(f.doc("userdoc:test:1:1", 10));
- docs.push_back(f.doc("userdoc:test:1:2", 11));
- docs.push_back(f.doc("userdoc:test:1:3", 12));
- docs.push_back(f.doc("userdoc:test:2:1", 13));
- docs.push_back(f.doc("userdoc:test:2:2", 14));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:1", 10));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:2", 11));
+ docs.push_back(f.doc("id:test:searchdocument:n=1:3", 12));
+ docs.push_back(f.doc("id:test:searchdocument:n=2:1", 13));
+ docs.push_back(f.doc("id:test:searchdocument:n=2:2", 14));
f.putAndWait(docs);
f.removeAndWait(docs[0]);
diff --git a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
index b11525bae3d..2d5f86fbc58 100644
--- a/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/storeonlyfeedview/storeonlyfeedview_test.cpp
@@ -236,7 +236,7 @@ struct FixtureBase {
void addSingleDocToMetaStore(uint32_t expected_lid) {
using Result = DocumentMetaStore::Result;
- DocumentId id(make_string("groupdoc:test:foo:%d", expected_lid));
+ DocumentId id(make_string("id:test:foo:g=foo:%d", expected_lid));
Result inspect = metaStore->inspect(id.getGlobalId());
uint32_t docSize = 1;
EXPECT_EQUAL(expected_lid,
@@ -341,7 +341,7 @@ TEST_F("require that handleMove() adds document to target and removes it from so
TEST_F("require that handleMove() handles move within same subdb and propagates destructor callback", MoveFixture)
{
Document::SP doc(new Document);
- DocumentId doc1id("groupdoc:test:foo:1");
+ DocumentId doc1id("id:test:foo:g=foo:1");
uint32_t docSize = 1;
f.runInMaster([&] () { f.metaStore->put(doc1id.getGlobalId(),
doc1id.getGlobalId().convertToBucketId(),
diff --git a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
index 8fa66e65af3..462d41e765c 100644
--- a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
@@ -566,7 +566,7 @@ createGid(uint32_t lid)
GlobalId
createGid(uint32_t userId, uint32_t lid)
{
- DocumentId docId(vespalib::make_string("userdoc:id:%u:%u", userId, lid));
+ DocumentId docId(vespalib::make_string("id:id:testdoc:n=%u:%u", userId, lid));
return docId.getGlobalId();
}