diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-10-04 11:37:21 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-04 14:20:19 +0000 |
commit | 3f419f70b9ae6dffbb07c3f042a8482dc413c278 (patch) | |
tree | 0bfa00c37d2b0a00a3815536e3dc1f351e27d70b /searchcore/src/tests | |
parent | 80d54b0d844c964b0ce1cf42cce3f0373ef327a4 (diff) |
Use document::Bucket in storage::spi::Bucket to add bucket space.
Diffstat (limited to 'searchcore/src/tests')
4 files changed, 14 insertions, 6 deletions
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp index 3c891ff4c11..bef65add869 100644 --- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp +++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp @@ -6,6 +6,7 @@ #include <vespa/persistence/spi/bucket.h> #include <vespa/persistence/spi/docentry.h> #include <vespa/persistence/spi/result.h> +#include <vespa/persistence/spi/test.h> #include <vespa/searchcore/proton/common/attrupdate.h> #include <vespa/searchcore/proton/persistenceengine/document_iterator.h> #include <vespa/searchcore/proton/server/commit_and_wait_document_retriever.h> @@ -43,6 +44,7 @@ using storage::spi::IterateResult; using storage::spi::PartitionId; using storage::spi::Selection; using storage::spi::Timestamp; +using storage::spi::test::makeBucket; using namespace proton; using namespace search::index; @@ -50,7 +52,7 @@ using namespace search::index; const uint64_t largeNum = 10000000; Bucket bucket(size_t x) { - return Bucket(BucketId(x), PartitionId(0)); + return makeBucket(BucketId(x)); } Selection selectAll() { diff --git a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp index 6fda983e88c..950571df6a4 100644 --- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp @@ -5,6 +5,7 @@ LOG_SETUP("buckethandler_test"); #include <vespa/searchcore/proton/server/ibucketstatechangedhandler.h> #include <vespa/searchcore/proton/server/ibucketmodifiedhandler.h> #include <vespa/searchcore/proton/test/test.h> +#include <vespa/persistence/spi/test.h> #include <vespa/vespalib/testkit/testapp.h> using namespace proton; @@ -14,6 +15,7 @@ using storage::spi::Bucket; using storage::spi::BucketInfo; using storage::spi::PartitionId; using storage::spi::Timestamp; +using storage::spi::test::makeBucket; using vespalib::ThreadStackExecutor; using proton::test::BucketStateCalculator; @@ -144,7 +146,7 @@ struct Fixture } void sync() { _exec.sync(); } void handleGetBucketInfo(const BucketId &bucket) { - _handler.handleGetBucketInfo(Bucket(bucket, PART_ID), _bucketInfo); + _handler.handleGetBucketInfo(makeBucket(bucket, PART_ID), _bucketInfo); } void setNodeUp(bool value) diff --git a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp index a7c4b0e5774..2e7e50c3464 100644 --- a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp +++ b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp @@ -2,6 +2,7 @@ #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/datatype/documenttype.h> #include <vespa/persistence/spi/documentselection.h> +#include <vespa/persistence/spi/test.h> #include <vespa/searchcore/proton/persistenceengine/bucket_guard.h> #include <vespa/searchcore/proton/persistenceengine/ipersistenceengineowner.h> #include <vespa/searchcore/proton/persistenceengine/persistenceengine.h> @@ -35,6 +36,7 @@ using storage::spi::Result; using storage::spi::Selection; using storage::spi::Timestamp; using storage::spi::UpdateResult; +using storage::spi::test::makeBucket; using namespace proton; using namespace vespalib; @@ -378,8 +380,8 @@ BucketId bckId1(1); BucketId bckId2(2); BucketId bckId3(3); Bucket bucket0; -Bucket bucket1(bckId1, partId); -Bucket bucket2(bckId2, partId); +Bucket bucket1(makeBucket(bckId1, partId)); +Bucket bucket2(makeBucket(bckId2, partId)); BucketChecksum checksum1(1); BucketChecksum checksum2(2); BucketChecksum checksum3(1+2); diff --git a/searchcore/src/tests/proton/server/documentretriever_test.cpp b/searchcore/src/tests/proton/server/documentretriever_test.cpp index df444d26f8c..b949046e8b6 100644 --- a/searchcore/src/tests/proton/server/documentretriever_test.cpp +++ b/searchcore/src/tests/proton/server/documentretriever_test.cpp @@ -19,6 +19,7 @@ #include <vespa/document/repo/documenttyperepo.h> #include <vespa/persistence/spi/bucket.h> #include <vespa/persistence/spi/result.h> +#include <vespa/persistence/spi/test.h> #include <vespa/searchcommon/common/schema.h> #include <vespa/searchcore/proton/documentmetastore/documentmetastorecontext.h> #include <vespa/searchcore/proton/server/documentretriever.h> @@ -69,6 +70,7 @@ using storage::spi::Bucket; using storage::spi::GetResult; using storage::spi::PartitionId; using storage::spi::Timestamp; +using storage::spi::test::makeBucket; using vespalib::make_string; using vespalib::string; using namespace document::config_builder; @@ -324,12 +326,12 @@ TEST_F("require that document retriever can retrieve document meta data", TEST_F("require that document retriever can retrieve bucket meta data", Fixture) { DocumentMetaData::Vector result; - f._retriever->getBucketMetaData(Bucket(f.bucket_id, PartitionId(0)), result); + f._retriever->getBucketMetaData(makeBucket(f.bucket_id, PartitionId(0)), result); ASSERT_EQUAL(1u, result.size()); EXPECT_EQUAL(f.lid, result[0].lid); EXPECT_EQUAL(f.timestamp, result[0].timestamp); result.clear(); - f._retriever->getBucketMetaData(Bucket(BucketId(f.bucket_id.getId() + 1), + f._retriever->getBucketMetaData(makeBucket(BucketId(f.bucket_id.getId() + 1), PartitionId(0)), result); EXPECT_EQUAL(0u, result.size()); } |