diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-10-20 12:21:17 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-20 12:21:17 +0000 |
commit | 243b342cb14539cf3c9a2fd520084e7164e49dcd (patch) | |
tree | 545596c662c23d9043ecb125a8e1e14a44a29495 | |
parent | 5fd803fe826569265db2f76d327610ac829ed7ea (diff) |
Rename storage::spi::test::makeBucket to storage::spi::test::makeSpiBucket.
26 files changed, 203 insertions, 203 deletions
diff --git a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp index 07bff2038e0..ba540d851a9 100644 --- a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp @@ -8,7 +8,7 @@ #include <vespa/persistence/spi/test.h> #include <vespa/vdstestlib/cppunit/macros.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace memfile { @@ -144,7 +144,7 @@ BasicOperationHandlerTest::testRemove() Timestamp(2), OperationHandler::PERSIST_REMOVE_IF_FOUND)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); env()._cache.clear(); @@ -178,7 +178,7 @@ BasicOperationHandlerTest::doTestRemoveWithNonMatchingTimestamp( Timestamp(1233), persistRemove)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); MemFilePtr file(getMemFile(bucketId)); CPPUNIT_ASSERT_EQUAL( @@ -241,7 +241,7 @@ BasicOperationHandlerTest::testRemoveForExistingRemoveSameTimestamp() Timestamp(1235), OperationHandler::PERSIST_REMOVE_IF_FOUND)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); // Should only be one remove entry still MemFilePtr file(getMemFile(bucketId)); @@ -271,7 +271,7 @@ BasicOperationHandlerTest::doTestRemoveForExistingRemoveNewTimestamp( Timestamp(1236), persistRemove)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); MemFilePtr file(getMemFile(bucketId)); CPPUNIT_ASSERT_EQUAL( @@ -325,14 +325,14 @@ BasicOperationHandlerTest::testRemoveExistingOlderDocumentVersion() Timestamp(1235), OperationHandler::ALWAYS_PERSIST_REMOVE)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); CPPUNIT_ASSERT_EQUAL(true, doRemove(bucketId, doc->getId(), Timestamp(1234), OperationHandler::ALWAYS_PERSIST_REMOVE)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); // Should now be two remove entries. MemFilePtr file(getMemFile(bucketId)); @@ -362,7 +362,7 @@ BasicOperationHandlerTest::doTestRemoveDocumentNotFound( Timestamp(1235), persistRemove)); - getPersistenceProvider().flush(makeBucket(bucketId), context); + getPersistenceProvider().flush(makeSpiBucket(bucketId), context); MemFilePtr file(getMemFile(bucketId)); CPPUNIT_ASSERT_EQUAL( @@ -576,8 +576,8 @@ BasicOperationHandlerTest::testRemoveEntry() Document::SP doc = doPut(4, Timestamp(2345)); doPut(4, Timestamp(3456)); - getPersistenceProvider().removeEntry(makeBucket(bucketId), spi::Timestamp(1234), context); - getPersistenceProvider().removeEntry(makeBucket(bucketId), spi::Timestamp(3456), context); + getPersistenceProvider().removeEntry(makeSpiBucket(bucketId), spi::Timestamp(1234), context); + getPersistenceProvider().removeEntry(makeSpiBucket(bucketId), spi::Timestamp(3456), context); flush(bucketId); memfile::MemFilePtr file(getMemFile(bucketId)); @@ -674,7 +674,7 @@ BasicOperationHandlerTest::testEraseFromCacheOnMaintainException() std::unique_ptr<Environment::LazyFileFactory>( new SimulatedFailureLazyFile::Factory); - spi::Result result = getPersistenceProvider().maintain(makeBucket(bucketId), spi::HIGH); + spi::Result result = getPersistenceProvider().maintain(makeSpiBucket(bucketId), spi::HIGH); CPPUNIT_ASSERT(result.hasError()); CPPUNIT_ASSERT(result.getErrorMessage().find("A simulated I/O write") != vespalib::string::npos); @@ -709,7 +709,7 @@ BasicOperationHandlerTest::testEraseFromCacheOnDeleteBucketException() std::unique_ptr<Environment::LazyFileFactory>(factory); // loadFile will fail - spi::Result result = getPersistenceProvider().deleteBucket(makeBucket(bucketId), context); + spi::Result result = getPersistenceProvider().deleteBucket(makeSpiBucket(bucketId), context); CPPUNIT_ASSERT(result.hasError()); CPPUNIT_ASSERT(result.getErrorMessage().find("A simulated I/O read") != vespalib::string::npos); diff --git a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp index 6deabc3dfe1..418ead076fd 100644 --- a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp @@ -7,7 +7,7 @@ #include <vespa/persistence/spi/test.h> #include <vespa/document/select/parser.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace memfile { @@ -122,7 +122,7 @@ IteratorHandlerTest::createSelection(const std::string& docSel) const void IteratorHandlerTest::testCreateIterator() { - spi::Bucket b(makeBucket(BucketId(16, 1234))); + spi::Bucket b(makeSpiBucket(BucketId(16, 1234))); spi::CreateIteratorResult iter1(create(b, createSelection("true"))); CPPUNIT_ASSERT_EQUAL(spi::IteratorId(1), iter1.getIteratorId()); @@ -290,7 +290,7 @@ IteratorHandlerTest::testSomeSlotsRemovedBetweenInvocations() { std::vector<DocAndTimestamp> docs = feedDocs(100, 4096, 4096); - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter(create(b, sel)); @@ -330,7 +330,7 @@ IteratorHandlerTest::testAllSlotsRemovedBetweenInvocations() { std::vector<DocAndTimestamp> docs = feedDocs(100, 4096, 4096); - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter(create(b, sel)); @@ -362,7 +362,7 @@ IteratorHandlerTest::testAllSlotsRemovedBetweenInvocations() void IteratorHandlerTest::testIterateMetadataOnly() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); std::vector<DocAndTimestamp> docs = feedDocs(10); CPPUNIT_ASSERT( @@ -418,7 +418,7 @@ IteratorHandlerTest::testIterateHeadersOnly() clearBody(*docs[i].first); } - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter(create(b, sel, spi::NEWEST_DOCUMENT_ONLY, @@ -439,7 +439,7 @@ IteratorHandlerTest::testIterateLargeDocument() std::vector<DocAndTimestamp> largedoc; largedoc.push_back(docs.back()); - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter(create(b, sel)); @@ -458,7 +458,7 @@ IteratorHandlerTest::testDocumentsRemovedBetweenInvocations() int docCount = 100; std::vector<DocAndTimestamp> docs = feedDocs(docCount); - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter(create(b, sel)); @@ -500,7 +500,7 @@ IteratorHandlerTest::doTestUnrevertableRemoveBetweenInvocations(bool includeRemo int docCount = 100; std::vector<DocAndTimestamp> docs = feedDocs(docCount); - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); spi::Selection sel(createSelection("true")); spi::CreateIteratorResult iter( create(b, sel, @@ -594,7 +594,7 @@ IteratorHandlerTest::testMatchTimestampRangeDocAltered() OperationHandler::PERSIST_REMOVE_IF_FOUND)); flush(bucketId); - spi::Bucket b(makeBucket(bucketId)); + spi::Bucket b(makeSpiBucket(bucketId)); { spi::Selection sel(createSelection("true")); @@ -699,7 +699,7 @@ IteratorHandlerTest::testMatchTimestampRangeDocAltered() void IteratorHandlerTest::testIterateAllVersions() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); std::vector<DocAndTimestamp> docs; Document::SP originalDoc(createRandomDocumentAtLocation( @@ -736,7 +736,7 @@ IteratorHandlerTest::testIterateAllVersions() void IteratorHandlerTest::testFieldSetFiltering() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); Document::SP doc(createRandomDocumentAtLocation( 4, 1001, 110, 110)); doc->setValue(doc->getField("headerval"), document::IntFieldValue(42)); @@ -763,7 +763,7 @@ IteratorHandlerTest::testFieldSetFiltering() void IteratorHandlerTest::testIteratorInactiveOnException() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); feedDocs(10); env()._cache.clear(); @@ -790,7 +790,7 @@ IteratorHandlerTest::testIteratorInactiveOnException() void IteratorHandlerTest::testDocsCachedBeforeDocumentSelection() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); std::vector<DocAndTimestamp> docs = feedDocs(100, 4096, 4096); env()._cache.clear(); @@ -819,7 +819,7 @@ IteratorHandlerTest::testDocsCachedBeforeDocumentSelection() void IteratorHandlerTest::testTimestampRangeLimitedPrefetch() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); // Feed docs with timestamp range [1000, 1100) feedDocs(100, 4096, 4096); @@ -907,7 +907,7 @@ IteratorHandlerTest::testCachePrefetchRequirements() void IteratorHandlerTest::testBucketEvictedFromCacheOnIterateException() { - spi::Bucket b(makeBucket(BucketId(16, 4))); + spi::Bucket b(makeSpiBucket(BucketId(16, 4))); feedDocs(10); env()._cache.clear(); diff --git a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp index 07c2bab5bae..67542afd12f 100644 --- a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp @@ -5,7 +5,7 @@ #include <vespa/persistence/spi/test.h> using document::DocumentType; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace memfile { @@ -140,9 +140,9 @@ JoinOperationHandlerTest::doJoin(const document::BucketId to, spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); return getPersistenceProvider().join( - makeBucket(from1), - makeBucket(from2), - makeBucket(to), + makeSpiBucket(from1), + makeSpiBucket(from2), + makeSpiBucket(to), context); } @@ -252,9 +252,9 @@ JoinOperationHandlerTest::testMultiDisk() setupDisks(10); feedMultiDisk(); - getPersistenceProvider().join(makeBucket(SOURCE2, spi::PartitionId(7)), - makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(TARGET, spi::PartitionId(3)), + getPersistenceProvider().join(makeSpiBucket(SOURCE2, spi::PartitionId(7)), + makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(TARGET, spi::PartitionId(3)), context); CPPUNIT_ASSERT_EQUAL( @@ -278,9 +278,9 @@ JoinOperationHandlerTest::testMultiDiskFlushed() env()._cache.flushDirtyEntries(); env()._cache.clear(); - getPersistenceProvider().join(makeBucket(SOURCE2, spi::PartitionId(7)), - makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(TARGET, spi::PartitionId(3)), + getPersistenceProvider().join(makeSpiBucket(SOURCE2, spi::PartitionId(7)), + makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(TARGET, spi::PartitionId(3)), context); CPPUNIT_ASSERT_EQUAL( @@ -324,9 +324,9 @@ JoinOperationHandlerTest::testInternalJoin() mon->overrideRealStat(512, 100000, 50000); CPPUNIT_ASSERT(!mon->isFull(0, .80f)); - getPersistenceProvider().join(makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(SOURCE1, spi::PartitionId(5)), + getPersistenceProvider().join(makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(SOURCE1, spi::PartitionId(5)), context); env()._cache.clear(); @@ -370,9 +370,9 @@ JoinOperationHandlerTest::testInternalJoinDiskFull() CPPUNIT_ASSERT(mon->isFull(0, .08f)); spi::Result result = - getPersistenceProvider().join(makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(SOURCE1, spi::PartitionId(4)), - makeBucket(SOURCE1, spi::PartitionId(5)), + getPersistenceProvider().join(makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(SOURCE1, spi::PartitionId(4)), + makeSpiBucket(SOURCE1, spi::PartitionId(5)), context); CPPUNIT_ASSERT(result.hasError()); diff --git a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp b/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp index 1bae9d929e3..b7fbeba1649 100644 --- a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp +++ b/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp @@ -6,7 +6,7 @@ #include <tests/spi/memfiletestutils.h> #include <vespa/persistence/spi/test.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace memfile { @@ -226,7 +226,7 @@ MemFileAutoRepairTest::testRepairFailureInMaintainEvictsBucketFromCache() prepareBucket(*this, *_file); corruptBodyBlock(); spi::Result result(getPersistenceProvider().maintain( - makeBucket(_bucket), spi::HIGH)); + makeSpiBucket(_bucket), spi::HIGH)); // File being successfully repaired does not constitute a failure of // the maintain() call. CPPUNIT_ASSERT_EQUAL(spi::Result::NONE, result.getErrorCode()); @@ -243,7 +243,7 @@ MemFileAutoRepairTest::testZeroLengthFileIsDeleted() // No way to deal with zero-length files aside from deleting them. spi::Result result(getPersistenceProvider().maintain( - makeBucket(_bucket), spi::HIGH)); + makeSpiBucket(_bucket), spi::HIGH)); CPPUNIT_ASSERT_EQUAL(spi::Result::NONE, result.getErrorCode()); CPPUNIT_ASSERT(!env()._cache.contains(_bucket)); CPPUNIT_ASSERT(!vespalib::fileExists(_file->getPath())); @@ -275,7 +275,7 @@ MemFileAutoRepairTest::assertDocumentIsSilentlyRemoved( { // Corrupted (truncated) slot should be transparently removed during // loadFile and it should be as if it was never there! - spi::Bucket spiBucket(makeBucket(bucket)); + spi::Bucket spiBucket(makeSpiBucket(bucket)); spi::GetResult res(doGet(spiBucket, docId, document::AllFields())); CPPUNIT_ASSERT_EQUAL(spi::Result::NONE, res.getErrorCode()); CPPUNIT_ASSERT(!res.hasDocument()); diff --git a/memfilepersistence/src/tests/spi/memfiletestutils.cpp b/memfilepersistence/src/tests/spi/memfiletestutils.cpp index 71a3e6a0999..04f2e87c812 100644 --- a/memfilepersistence/src/tests/spi/memfiletestutils.cpp +++ b/memfilepersistence/src/tests/spi/memfiletestutils.cpp @@ -13,7 +13,7 @@ #include <sys/time.h> using document::DocumentType; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using storage::spi::test::makeBucketSpace; namespace storage { @@ -139,7 +139,7 @@ MemFileTestUtils::flush(const document::BucketId& id, uint16_t disk) spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); return getPersistenceProvider().flush( - makeBucket(id, spi::PartitionId(disk)), context); + makeSpiBucket(id, spi::PartitionId(disk)), context); } document::Document::SP @@ -155,7 +155,7 @@ MemFileTestUtils::doPutOnDisk( document::Document::SP doc(createRandomDocumentAtLocation( location, timestamp.getTime(), minSize, maxSize)); getPersistenceProvider().put( - makeBucket(document::BucketId(16, location), spi::PartitionId(disk)), + makeSpiBucket(document::BucketId(16, location), spi::PartitionId(disk)), spi::Timestamp(timestamp.getTime()), doc, context); @@ -174,14 +174,14 @@ MemFileTestUtils::doRemoveOnDisk( spi::Trace::TraceLevel(0)); if (persistRemove == OperationHandler::PERSIST_REMOVE_IF_FOUND) { spi::RemoveResult result = getPersistenceProvider().removeIfFound( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), spi::Timestamp(timestamp.getTime()), docId, context); return result.wasFound(); } spi::RemoveResult result = getPersistenceProvider().remove( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), spi::Timestamp(timestamp.getTime()), docId, context); @@ -200,7 +200,7 @@ MemFileTestUtils::doUnrevertableRemoveOnDisk( spi::Trace::TraceLevel(0)); spi::RemoveResult result = getPersistenceProvider().remove( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), spi::Timestamp(timestamp.getTime()), docId, context); @@ -217,7 +217,7 @@ MemFileTestUtils::doGetOnDisk( spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); return getPersistenceProvider().get( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), fields, docId, context); } @@ -275,7 +275,7 @@ MemFileTestUtils::doPut(const document::Document::SP& doc, { spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); - getPersistenceProvider().put(makeBucket(bid, spi::PartitionId(disk)), + getPersistenceProvider().put(makeSpiBucket(bid, spi::PartitionId(disk)), spi::Timestamp(time.getTime()), doc, context); } @@ -288,7 +288,7 @@ MemFileTestUtils::doUpdate(document::BucketId bid, spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); return getPersistenceProvider().update( - makeBucket(bid, spi::PartitionId(disk)), + makeSpiBucket(bid, spi::PartitionId(disk)), spi::Timestamp(time.getTime()), update, context); } @@ -304,12 +304,12 @@ MemFileTestUtils::doRemove(const document::DocumentId& id, Timestamp time, if (unrevertableRemove) { getPersistenceProvider().remove( - makeBucket(bucket, spi::PartitionId(disk)), + makeSpiBucket(bucket, spi::PartitionId(disk)), spi::Timestamp(time.getTime()), id, context); } else { spi::RemoveResult result = getPersistenceProvider().removeIfFound( - makeBucket(bucket, spi::PartitionId(disk)), + makeSpiBucket(bucket, spi::PartitionId(disk)), spi::Timestamp(time.getTime()), id, context); diff --git a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp index 98f722e749c..89a7d0f6e03 100644 --- a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp @@ -5,7 +5,7 @@ #include <vespa/persistence/spi/test.h> using document::DocumentType; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace memfile { @@ -62,9 +62,9 @@ SplitOperationHandlerTest::testSimple() SplitOperationHandler handler(env()); spi::Result result = getPersistenceProvider().split( - makeBucket(sourceBucket), - makeBucket(target1), - makeBucket(target2), + makeSpiBucket(sourceBucket), + makeSpiBucket(target1), + makeSpiBucket(target2), context); env()._cache.clear(); @@ -118,9 +118,9 @@ SplitOperationHandlerTest::doTestMultiDisk(uint16_t sourceDisk, SplitOperationHandler handler(env()); spi::Result result = getPersistenceProvider().split( - makeBucket(sourceBucket, spi::PartitionId(sourceDisk)), - makeBucket(target1, spi::PartitionId(targetDisk0)), - makeBucket(target2, spi::PartitionId(targetDisk1)), + makeSpiBucket(sourceBucket, spi::PartitionId(sourceDisk)), + makeSpiBucket(target1, spi::PartitionId(targetDisk0)), + makeSpiBucket(target2, spi::PartitionId(targetDisk1)), context); env()._cache.clear(); @@ -185,9 +185,9 @@ SplitOperationHandlerTest::testExceptionDuringSplittingEvictsAllBuckets() try { SplitOperationHandler handler(env()); spi::Result result = getPersistenceProvider().split( - makeBucket(sourceBucket), - makeBucket(target1), - makeBucket(target2), + makeSpiBucket(sourceBucket), + makeSpiBucket(target1), + makeSpiBucket(target2), context); CPPUNIT_FAIL("Exception not thrown on flush failure"); } catch (std::exception&) { diff --git a/persistence/src/tests/spi/clusterstatetest.cpp b/persistence/src/tests/spi/clusterstatetest.cpp index 7d34ddd4b03..f742ca48284 100644 --- a/persistence/src/tests/spi/clusterstatetest.cpp +++ b/persistence/src/tests/spi/clusterstatetest.cpp @@ -8,7 +8,7 @@ #include <vespa/vdslib/state/clusterstate.h> #include <vespa/config-stor-distribution.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { namespace spi { @@ -172,7 +172,7 @@ ClusterStateTest::testReady() { lib::ClusterState s("version:1 storage:3 distributor:3"); - Bucket b(makeBucket(document::BucketId(16, 1))); + Bucket b(makeSpiBucket(document::BucketId(16, 1))); // With 3 copies, this bucket has ideal state 0, 2, 1 diff --git a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp index 662955be1b7..30aa19c6a86 100644 --- a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp +++ b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp @@ -18,7 +18,7 @@ using document::BucketId; using document::BucketSpace; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using storage::spi::test::makeBucketSpace; namespace storage::spi { @@ -313,7 +313,7 @@ void ConformanceTest::testBasics() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); spi->createBucket(bucket, context); @@ -399,9 +399,9 @@ void ConformanceTest::testListBuckets() { BucketId bucketId1(8, 0x01); BucketId bucketId2(8, 0x02); BucketId bucketId3(8, 0x03); - Bucket bucket1(makeBucket(bucketId1, partId)); - Bucket bucket2(makeBucket(bucketId2, partId)); - Bucket bucket3(makeBucket(bucketId3, partId)); + Bucket bucket1(makeSpiBucket(bucketId1, partId)); + Bucket bucket2(makeSpiBucket(bucketId2, partId)); + Bucket bucket3(makeSpiBucket(bucketId3, partId)); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x02, 2); @@ -439,7 +439,7 @@ void ConformanceTest::testBucketInfo() { _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); @@ -497,7 +497,7 @@ ConformanceTest::testOrderIndependentBucketInfo() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); @@ -542,7 +542,7 @@ void ConformanceTest::testPut() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); spi->createBucket(bucket, context); @@ -567,7 +567,7 @@ void ConformanceTest::testPutNewDocumentVersion() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2(doc1->clone()); doc2->setValue("content", document::StringFieldValue("hiho silver")); @@ -618,7 +618,7 @@ void ConformanceTest::testPutOlderDocumentVersion() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2(doc1->clone()); doc2->setValue("content", document::StringFieldValue("hiho silver")); @@ -662,7 +662,7 @@ void ConformanceTest::testPutDuplicate() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); spi->createBucket(bucket, context); CPPUNIT_ASSERT_EQUAL(Result(), @@ -695,7 +695,7 @@ void ConformanceTest::testRemove() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); spi->createBucket(bucket, context); @@ -791,7 +791,7 @@ void ConformanceTest::testRemoveMerge() { PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); DocumentId removeId("id:fraggle:testdoctype1:n=1:rock"); spi->createBucket(bucket, context); @@ -888,7 +888,7 @@ void ConformanceTest::testUpdate() { Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); spi->createBucket(bucket, context); const document::DocumentType *docType( @@ -964,7 +964,7 @@ void ConformanceTest::testGet() { Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); spi->createBucket(bucket, context); { @@ -1004,7 +1004,7 @@ ConformanceTest::testIterateCreateIterator() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); spi::CreateIteratorResult result( @@ -1024,7 +1024,7 @@ ConformanceTest::testIterateWithUnknownId() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); IteratorId unknownId(123); @@ -1039,7 +1039,7 @@ ConformanceTest::testIterateDestroyIterator() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); CreateIteratorResult iter(createIterator(*spi, b, createSelection(""))); @@ -1072,7 +1072,7 @@ ConformanceTest::testIterateAllDocs() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docs(feedDocs(*spi, testDocMan, b, 100)); @@ -1091,7 +1091,7 @@ ConformanceTest::testIterateAllDocsNewestVersionOnly() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docs(feedDocs(*spi, testDocMan, b, 100)); @@ -1121,7 +1121,7 @@ ConformanceTest::testIterateChunked() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docs(feedDocs(*spi, testDocMan, b, 100)); @@ -1142,7 +1142,7 @@ ConformanceTest::testMaxByteSize() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docs( @@ -1171,7 +1171,7 @@ ConformanceTest::testIterateMatchTimestampRange() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docsToVisit; @@ -1211,7 +1211,7 @@ ConformanceTest::testIterateExplicitTimestampSubset() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docsToVisit; @@ -1262,7 +1262,7 @@ ConformanceTest::testIterateRemoves() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); int docCount = 10; @@ -1315,7 +1315,7 @@ ConformanceTest::testIterateMatchSelection() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docsToVisit; @@ -1351,7 +1351,7 @@ ConformanceTest::testIterationRequiringDocumentIdOnlyMatching() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); feedDocs(*spi, testDocMan, b, 100); @@ -1385,7 +1385,7 @@ ConformanceTest::testIterateBadDocumentSelection() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); { CreateIteratorResult iter( @@ -1427,7 +1427,7 @@ ConformanceTest::testIterateAlreadyCompleted() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); std::vector<DocAndTimestamp> docs = feedDocs(*spi, testDocMan, b, 10); @@ -1452,7 +1452,7 @@ ConformanceTest::testIterateEmptyBucket() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket b(makeBucket(BucketId(8, 0x1))); + Bucket b(makeSpiBucket(BucketId(8, 0x1))); spi->createBucket(b, context); Selection sel(createSelection("")); @@ -1475,7 +1475,7 @@ ConformanceTest::testDeleteBucket() Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); spi->createBucket(bucket, context); spi->put(bucket, Timestamp(3), doc1, context); @@ -1519,10 +1519,10 @@ ConformanceTest::testSplitNormalCase() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucketA(makeBucket(BucketId(3, 0x02))); - Bucket bucketB(makeBucket(BucketId(3, 0x06))); + Bucket bucketA(makeSpiBucket(BucketId(3, 0x02))); + Bucket bucketB(makeSpiBucket(BucketId(3, 0x06))); - Bucket bucketC(makeBucket(BucketId(2, 0x02))); + Bucket bucketC(makeSpiBucket(BucketId(2, 0x02))); spi->createBucket(bucketC, context); TimestampList tsList; @@ -1595,11 +1595,11 @@ ConformanceTest::testSplitTargetExists() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucketA(makeBucket(BucketId(3, 0x02))); - Bucket bucketB(makeBucket(BucketId(3, 0x06))); + Bucket bucketA(makeSpiBucket(BucketId(3, 0x02))); + Bucket bucketB(makeSpiBucket(BucketId(3, 0x06))); spi->createBucket(bucketB, context); - Bucket bucketC(makeBucket(BucketId(2, 0x02))); + Bucket bucketC(makeSpiBucket(BucketId(2, 0x02))); spi->createBucket(bucketC, context); TimestampList tsList; @@ -1687,10 +1687,10 @@ ConformanceTest::testSplitSingleDocumentInSource() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket target1(makeBucket(BucketId(3, 0x02))); - Bucket target2(makeBucket(BucketId(3, 0x06))); + Bucket target1(makeSpiBucket(BucketId(3, 0x02))); + Bucket target2(makeSpiBucket(BucketId(3, 0x06))); - Bucket source(makeBucket(BucketId(2, 0x02))); + Bucket source(makeSpiBucket(BucketId(2, 0x02))); spi->createBucket(source, context); // Create doc belonging in target2 after split. @@ -1795,18 +1795,18 @@ ConformanceTest::doTestJoinNormalCase(const Bucket& source1, void ConformanceTest::testJoinNormalCase() { - Bucket source1(makeBucket(BucketId(3, 0x02))); - Bucket source2(makeBucket(BucketId(3, 0x06))); - Bucket target(makeBucket(BucketId(2, 0x02))); + Bucket source1(makeSpiBucket(BucketId(3, 0x02))); + Bucket source2(makeSpiBucket(BucketId(3, 0x06))); + Bucket target(makeSpiBucket(BucketId(2, 0x02))); doTestJoinNormalCase(source1, source2, target); } void ConformanceTest::testJoinNormalCaseWithMultipleBitsDecreased() { - Bucket source1(makeBucket(BucketId(3, 0x02))); - Bucket source2(makeBucket(BucketId(3, 0x06))); - Bucket target(makeBucket(BucketId(1, 0x00))); + Bucket source1(makeSpiBucket(BucketId(3, 0x02))); + Bucket source2(makeSpiBucket(BucketId(3, 0x06))); + Bucket target(makeSpiBucket(BucketId(1, 0x00))); doTestJoinNormalCase(source1, source2, target); } @@ -1853,13 +1853,13 @@ ConformanceTest::testJoinTargetExists() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucketA(makeBucket(BucketId(3, 0x02))); + Bucket bucketA(makeSpiBucket(BucketId(3, 0x02))); spi->createBucket(bucketA, context); - Bucket bucketB(makeBucket(BucketId(3, 0x06))); + Bucket bucketB(makeSpiBucket(BucketId(3, 0x06))); spi->createBucket(bucketB, context); - Bucket bucketC(makeBucket(BucketId(2, 0x02))); + Bucket bucketC(makeSpiBucket(BucketId(2, 0x02))); spi->createBucket(bucketC, context); for (uint32_t i = 0; i < 10; ++i) { @@ -1957,11 +1957,11 @@ ConformanceTest::testJoinOneBucket() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucketA(makeBucket(BucketId(3, 0x02))); + Bucket bucketA(makeSpiBucket(BucketId(3, 0x02))); spi->createBucket(bucketA, context); - Bucket bucketB(makeBucket(BucketId(3, 0x06))); - Bucket bucketC(makeBucket(BucketId(2, 0x02))); + Bucket bucketB(makeSpiBucket(BucketId(3, 0x06))); + Bucket bucketC(makeSpiBucket(BucketId(2, 0x02))); populateBucket(bucketA, *spi, context, 0, 10, testDocMan); @@ -2034,16 +2034,16 @@ ConformanceTest::doTestJoinSameSourceBuckets(const Bucket& source, void ConformanceTest::testJoinSameSourceBuckets() { - Bucket source(makeBucket(BucketId(3, 0x02))); - Bucket target(makeBucket(BucketId(2, 0x02))); + Bucket source(makeSpiBucket(BucketId(3, 0x02))); + Bucket target(makeSpiBucket(BucketId(2, 0x02))); doTestJoinSameSourceBuckets(source, target); } void ConformanceTest::testJoinSameSourceBucketsWithMultipleBitsDecreased() { - Bucket source(makeBucket(BucketId(3, 0x02))); - Bucket target(makeBucket(BucketId(1, 0x00))); + Bucket source(makeSpiBucket(BucketId(3, 0x02))); + Bucket target(makeSpiBucket(BucketId(1, 0x00))); doTestJoinSameSourceBuckets(source, target); } @@ -2076,10 +2076,10 @@ ConformanceTest::testJoinSameSourceBucketsTargetExists() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket source(makeBucket(BucketId(3, 0x02))); + Bucket source(makeSpiBucket(BucketId(3, 0x02))); spi->createBucket(source, context); - Bucket target(makeBucket(BucketId(2, 0x02))); + Bucket target(makeSpiBucket(BucketId(2, 0x02))); spi->createBucket(target, context); populateBucket(source, *spi, context, 0, 10, testDocMan); @@ -2105,7 +2105,7 @@ void ConformanceTest::testMaintain() Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); spi->createBucket(bucket, context); spi->put(bucket, Timestamp(3), doc1, context); @@ -2134,7 +2134,7 @@ void ConformanceTest::testBucketActivation() _factory->clear(); PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); spi->setClusterState(createClusterState()); spi->createBucket(bucket, context); @@ -2178,9 +2178,9 @@ void ConformanceTest::testBucketActivationSplitAndJoin() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucketA(makeBucket(BucketId(3, 0x02))); - Bucket bucketB(makeBucket(BucketId(3, 0x06))); - Bucket bucketC(makeBucket(BucketId(2, 0x02))); + Bucket bucketA(makeSpiBucket(BucketId(3, 0x02))); + Bucket bucketB(makeSpiBucket(BucketId(3, 0x06))); + Bucket bucketC(makeSpiBucket(BucketId(2, 0x02))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x02, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x06, 2); @@ -2257,7 +2257,7 @@ void ConformanceTest::testRemoveEntry() PersistenceProvider::UP spi(getSpi(*_factory, testDocMan)); Context context(defaultLoadType, Priority(0), Trace::TraceLevel(0)); - Bucket bucket(makeBucket(BucketId(8, 0x01))); + Bucket bucket(makeSpiBucket(BucketId(8, 0x01))); Document::SP doc1 = testDocMan.createRandomDocumentAtLocation(0x01, 1); Document::SP doc2 = testDocMan.createRandomDocumentAtLocation(0x01, 2); spi->createBucket(bucket, context); diff --git a/persistence/src/vespa/persistence/spi/test.cpp b/persistence/src/vespa/persistence/spi/test.cpp index d91f7fdfc1c..e376bd6b4d4 100644 --- a/persistence/src/vespa/persistence/spi/test.cpp +++ b/persistence/src/vespa/persistence/spi/test.cpp @@ -25,14 +25,14 @@ BucketSpace makeBucketSpace(const vespalib::string &docTypeName) } } -Bucket makeBucket(BucketId bucketId, PartitionId partitionId) +Bucket makeSpiBucket(BucketId bucketId, PartitionId partitionId) { return Bucket(document::Bucket(BucketSpace::placeHolder(), bucketId), partitionId); } -Bucket makeBucket(BucketId bucketId) +Bucket makeSpiBucket(BucketId bucketId) { - return makeBucket(bucketId, PartitionId(0)); + return makeSpiBucket(bucketId, PartitionId(0)); } } diff --git a/persistence/src/vespa/persistence/spi/test.h b/persistence/src/vespa/persistence/spi/test.h index cbd546d6315..06bade014ab 100644 --- a/persistence/src/vespa/persistence/spi/test.h +++ b/persistence/src/vespa/persistence/spi/test.h @@ -10,7 +10,7 @@ namespace storage::spi::test { document::BucketSpace makeBucketSpace(); document::BucketSpace makeBucketSpace(const vespalib::string &docTypeName); -Bucket makeBucket(document::BucketId bucketId, PartitionId partitionId); -Bucket makeBucket(document::BucketId bucketId); +Bucket makeSpiBucket(document::BucketId bucketId, PartitionId partitionId); +Bucket makeSpiBucket(document::BucketId bucketId); } 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 bef65add869..b3b05d03b9f 100644 --- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp +++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp @@ -44,7 +44,7 @@ using storage::spi::IterateResult; using storage::spi::PartitionId; using storage::spi::Selection; using storage::spi::Timestamp; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using namespace proton; using namespace search::index; @@ -52,7 +52,7 @@ using namespace search::index; const uint64_t largeNum = 10000000; Bucket bucket(size_t x) { - return makeBucket(BucketId(x)); + return makeSpiBucket(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 950571df6a4..677ad0a9883 100644 --- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp +++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp @@ -15,7 +15,7 @@ using storage::spi::Bucket; using storage::spi::BucketInfo; using storage::spi::PartitionId; using storage::spi::Timestamp; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using vespalib::ThreadStackExecutor; using proton::test::BucketStateCalculator; @@ -146,7 +146,7 @@ struct Fixture } void sync() { _exec.sync(); } void handleGetBucketInfo(const BucketId &bucket) { - _handler.handleGetBucketInfo(makeBucket(bucket, PART_ID), _bucketInfo); + _handler.handleGetBucketInfo(makeSpiBucket(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 f7b35851696..9e13cf2ff7d 100644 --- a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp +++ b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp @@ -41,7 +41,7 @@ using storage::spi::Result; using storage::spi::Selection; using storage::spi::Timestamp; using storage::spi::UpdateResult; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using storage::spi::test::makeBucketSpace; using namespace proton; using namespace vespalib; @@ -354,8 +354,8 @@ BucketId bckId1(1); BucketId bckId2(2); BucketId bckId3(3); Bucket bucket0; -Bucket bucket1(makeBucket(bckId1, partId)); -Bucket bucket2(makeBucket(bckId2, partId)); +Bucket bucket1(makeSpiBucket(bckId1, partId)); +Bucket bucket2(makeSpiBucket(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 b949046e8b6..69e90a6fdf8 100644 --- a/searchcore/src/tests/proton/server/documentretriever_test.cpp +++ b/searchcore/src/tests/proton/server/documentretriever_test.cpp @@ -70,7 +70,7 @@ using storage::spi::Bucket; using storage::spi::GetResult; using storage::spi::PartitionId; using storage::spi::Timestamp; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using vespalib::make_string; using vespalib::string; using namespace document::config_builder; @@ -326,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(makeBucket(f.bucket_id, PartitionId(0)), result); + f._retriever->getBucketMetaData(makeSpiBucket(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(makeBucket(BucketId(f.bucket_id.getId() + 1), + f._retriever->getBucketMetaData(makeSpiBucket(BucketId(f.bucket_id.getId() + 1), PartitionId(0)), result); EXPECT_EQUAL(0u, result.size()); } diff --git a/searchcore/src/vespa/searchcore/proton/test/bucketfactory.cpp b/searchcore/src/vespa/searchcore/proton/test/bucketfactory.cpp index 37c0a965f48..463b825191e 100644 --- a/searchcore/src/vespa/searchcore/proton/test/bucketfactory.cpp +++ b/searchcore/src/vespa/searchcore/proton/test/bucketfactory.cpp @@ -7,7 +7,7 @@ using document::BucketId; using document::DocumentId; using storage::spi::Bucket; using storage::spi::PartitionId; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace proton { @@ -23,7 +23,7 @@ BucketFactory::getBucketId(const DocumentId &docId) Bucket BucketFactory::getBucket(const DocumentId &docId) { - return makeBucket(getBucketId(docId)); + return makeSpiBucket(getBucketId(docId)); } } // namespace proton diff --git a/storage/src/tests/persistence/common/filestortestfixture.cpp b/storage/src/tests/persistence/common/filestortestfixture.cpp index 4694e8df363..4e2ddeb9616 100644 --- a/storage/src/tests/persistence/common/filestortestfixture.cpp +++ b/storage/src/tests/persistence/common/filestortestfixture.cpp @@ -8,7 +8,7 @@ #include <vespa/persistence/spi/test.h> #include <sstream> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -55,7 +55,7 @@ FileStorTestFixture::createBucket(const document::BucketId& bid) spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); _node->getPersistenceProvider().createBucket( - makeBucket(bid), context); + makeSpiBucket(bid), context); StorBucketDatabase::WrappedEntry entry( _node->getStorageBucketDatabase().get(bid, "foo", diff --git a/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp b/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp index e76828c1eb2..4656924c1b6 100644 --- a/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp +++ b/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp @@ -8,7 +8,7 @@ #include <vespa/persistence/dummyimpl/dummypersistence.h> #include <tests/persistence/common/filestortestfixture.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { @@ -44,7 +44,7 @@ DeactivateBucketsTest::bucketsInDatabaseDeactivatedWhenNodeDownInClusterState() lib::ClusterState::CSP(new lib::ClusterState(upState))); document::BucketId bucket(8, 123); - spi::Bucket spiBucket(makeBucket(bucket)); + spi::Bucket spiBucket(makeSpiBucket(bucket)); createBucket(bucket); api::BucketInfo serviceLayerInfo(1, 2, 3, 4, 5, true, true); diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index 7b6bd4c5a86..bbfe2c19c7b 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -40,7 +40,7 @@ LOG_SETUP(".filestormanagertest"); using std::unique_ptr; using document::Document; using namespace storage::api; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; #define ASSERT_SINGLE_REPLY(replytype, reply, link, time) \ @@ -158,7 +158,7 @@ struct FileStorManagerTest : public CppUnit::TestFixture { spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); _node->getPersistenceProvider().createBucket( - makeBucket(bid, spi::PartitionId(disk)), context); + makeSpiBucket(bid, spi::PartitionId(disk)), context); StorBucketDatabase::WrappedEntry entry( _node->getStorageBucketDatabase().get(bid, "foo", @@ -1310,7 +1310,7 @@ FileStorManagerTest::testPriority() spi::Trace::TraceLevel(0)); _node->getPersistenceProvider().createBucket( - makeBucket(bucket), context); + makeSpiBucket(bucket), context); } // Populate bucket with the given data @@ -1399,7 +1399,7 @@ FileStorManagerTest::testSplit1() documents[i]->getId()).getRawId()); _node->getPersistenceProvider().createBucket( - makeBucket(bucket), context); + makeSpiBucket(bucket), context); std::shared_ptr<api::PutCommand> cmd( new api::PutCommand(makeDocumentBucket(bucket), documents[i], 100 + i)); @@ -1574,7 +1574,7 @@ FileStorManagerTest::testSplitSingleGroup() documents[i]->getId()).getRawId()); _node->getPersistenceProvider().createBucket( - makeBucket(bucket), context); + makeSpiBucket(bucket), context); std::shared_ptr<api::PutCommand> cmd( new api::PutCommand(makeDocumentBucket(bucket), documents[i], 100 + i)); @@ -1649,7 +1649,7 @@ FileStorManagerTest::putDoc(DummyStorageLink& top, document::BucketId bucket(16, factory.getBucketId(docId).getRawId()); //std::cerr << "doc bucket is " << bucket << " vs source " << source << "\n"; _node->getPersistenceProvider().createBucket( - makeBucket(target), context); + makeSpiBucket(target), context); Document::SP doc(new Document(*_testdoctype1, docId)); std::shared_ptr<api::PutCommand> cmd( new api::PutCommand(makeDocumentBucket(target), doc, docNum+1)); @@ -1924,7 +1924,7 @@ createIterator(DummyStorageLink& link, framework::MicroSecTime toTime = framework::MicroSecTime::max(), bool headerOnly = false) { - spi::Bucket bucket(makeBucket(bucketId)); + spi::Bucket bucket(makeSpiBucket(bucketId)); spi::Selection selection = spi::Selection(spi::DocumentSelection(docSel)); @@ -2881,7 +2881,7 @@ FileStorManagerTest::testSetBucketActiveState() createBucket(bid, disk); spi::dummy::DummyPersistence& provider( dynamic_cast<spi::dummy::DummyPersistence&>(_node->getPersistenceProvider())); - CPPUNIT_ASSERT(!provider.isActive(makeBucket(bid, spi::PartitionId(disk)))); + CPPUNIT_ASSERT(!provider.isActive(makeSpiBucket(bid, spi::PartitionId(disk)))); { std::shared_ptr<api::SetBucketStateCommand> cmd( @@ -2899,7 +2899,7 @@ FileStorManagerTest::testSetBucketActiveState() CPPUNIT_ASSERT_EQUAL(ReturnCode(ReturnCode::OK), reply->getResult()); } - CPPUNIT_ASSERT(provider.isActive(makeBucket(bid, spi::PartitionId(disk)))); + CPPUNIT_ASSERT(provider.isActive(makeSpiBucket(bid, spi::PartitionId(disk)))); { StorBucketDatabase::WrappedEntry entry( _node->getStorageBucketDatabase().get( @@ -2943,7 +2943,7 @@ FileStorManagerTest::testSetBucketActiveState() CPPUNIT_ASSERT_EQUAL(ReturnCode(ReturnCode::OK), reply->getResult()); } - CPPUNIT_ASSERT(!provider.isActive(makeBucket(bid, spi::PartitionId(disk)))); + CPPUNIT_ASSERT(!provider.isActive(makeSpiBucket(bid, spi::PartitionId(disk)))); { StorBucketDatabase::WrappedEntry entry( _node->getStorageBucketDatabase().get( diff --git a/storage/src/tests/persistence/filestorage/filestormodifiedbucketstest.cpp b/storage/src/tests/persistence/filestorage/filestormodifiedbucketstest.cpp index 856add700e7..1fab3a8bcc1 100644 --- a/storage/src/tests/persistence/filestorage/filestormodifiedbucketstest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormodifiedbucketstest.cpp @@ -8,7 +8,7 @@ #include <vespa/persistence/dummyimpl/dummypersistence.h> #include <tests/persistence/common/filestortestfixture.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { @@ -76,7 +76,7 @@ FileStorModifiedBucketsTest::modifyBuckets(uint32_t first, uint32_t count) for (uint32_t i = 0; i < count; ++i) { buckets.push_back(document::BucketId(16, first + i)); _node->getPersistenceProvider().setActiveState( - makeBucket(buckets[i]), + makeSpiBucket(buckets[i]), spi::BucketInfo::ACTIVE); } @@ -94,7 +94,7 @@ FileStorModifiedBucketsTest::modifiedBucketsSendNotifyBucketChange() for (uint32_t i = 0; i < numBuckets; ++i) { document::BucketId bucket(16, i); - createBucket(makeBucket(bucket)); + createBucket(makeSpiBucket(bucket)); c.sendPut(bucket, DocumentIndex(0), PutTimestamp(1000)); } c.top.waitForMessages(numBuckets, MSG_WAIT_TIME); @@ -122,7 +122,7 @@ FileStorModifiedBucketsTest::fileStorRepliesToRecheckBucketCommands() setClusterState("storage:1 distributor:1"); document::BucketId bucket(16, 0); - createBucket(makeBucket(bucket)); + createBucket(makeSpiBucket(bucket)); c.sendPut(bucket, DocumentIndex(0), PutTimestamp(1000)); c.top.waitForMessages(1, MSG_WAIT_TIME); c.top.reset(); @@ -134,7 +134,7 @@ FileStorModifiedBucketsTest::fileStorRepliesToRecheckBucketCommands() // If we don't reply to the recheck bucket commands, we won't trigger // a new round of getModifiedBuckets and recheck commands. c.top.reset(); - createBucket(makeBucket(document::BucketId(16, 1))); + createBucket(makeSpiBucket(document::BucketId(16, 1))); modifyBuckets(1, 1); c.top.waitForMessages(1, MSG_WAIT_TIME); assertIsNotifyCommandWithActiveBucket(*c.top.getReply(0)); diff --git a/storage/src/tests/persistence/filestorage/sanitycheckeddeletetest.cpp b/storage/src/tests/persistence/filestorage/sanitycheckeddeletetest.cpp index 6f8741876aa..b906c9f67d6 100644 --- a/storage/src/tests/persistence/filestorage/sanitycheckeddeletetest.cpp +++ b/storage/src/tests/persistence/filestorage/sanitycheckeddeletetest.cpp @@ -8,7 +8,7 @@ #include <vespa/persistence/dummyimpl/dummypersistence.h> #include <tests/persistence/common/filestortestfixture.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -32,7 +32,7 @@ void SanityCheckedDeleteTest::delete_bucket_fails_when_provider_out_of_sync() { TestFileStorComponents c(*this, "delete_bucket_fails_when_provider_out_of_sync"); document::BucketId bucket(8, 123); document::BucketId syncBucket(8, 234); - spi::Bucket spiBucket(makeBucket(bucket)); + spi::Bucket spiBucket(makeSpiBucket(bucket)); // Send a put to ensure bucket isn't empty. spi::BucketInfo infoBefore(send_put_and_get_bucket_info(c, spiBucket)); @@ -86,7 +86,7 @@ spi::BucketInfo SanityCheckedDeleteTest::send_put_and_get_bucket_info( void SanityCheckedDeleteTest::differing_document_sizes_not_considered_out_of_sync() { TestFileStorComponents c(*this, "differing_document_sizes_not_considered_out_of_sync"); document::BucketId bucket(8, 123); - spi::Bucket spiBucket(makeBucket(bucket)); + spi::Bucket spiBucket(makeSpiBucket(bucket)); spi::BucketInfo info_before(send_put_and_get_bucket_info(c, spiBucket)); // Expect 1 byte of reported size, which will mismatch with the actually put document. diff --git a/storage/src/tests/persistence/legacyoperationhandlertest.cpp b/storage/src/tests/persistence/legacyoperationhandlertest.cpp index 40fe3119747..817f85eedc5 100644 --- a/storage/src/tests/persistence/legacyoperationhandlertest.cpp +++ b/storage/src/tests/persistence/legacyoperationhandlertest.cpp @@ -12,7 +12,7 @@ using document::DocumentTypeRepo; using document::TestDocRepo; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -34,7 +34,7 @@ public: spi::Context context(spi::LoadType(0, "default"), spi::Priority(0), spi::Trace::TraceLevel(0)); getPersistenceProvider().createBucket( - makeBucket(document::BucketId(16, 4)), + makeSpiBucket(document::BucketId(16, 4)), context); } diff --git a/storage/src/tests/persistence/persistencetestutils.cpp b/storage/src/tests/persistence/persistencetestutils.cpp index 480f236997a..c17c4837bfa 100644 --- a/storage/src/tests/persistence/persistencetestutils.cpp +++ b/storage/src/tests/persistence/persistencetestutils.cpp @@ -12,7 +12,7 @@ using document::DocumentType; using storage::framework::defaultimplementation::AllocationLogic; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -82,7 +82,7 @@ PersistenceTestUtils::~PersistenceTestUtils() std::string PersistenceTestUtils::dumpBucket(const document::BucketId& bid, uint16_t disk) { - return dynamic_cast<spi::dummy::DummyPersistence&>(_env->_node.getPersistenceProvider()).dumpBucket(makeBucket(bid, spi::PartitionId(disk))); + return dynamic_cast<spi::dummy::DummyPersistence&>(_env->_node.getPersistenceProvider()).dumpBucket(makeSpiBucket(bid, spi::PartitionId(disk))); } void @@ -169,7 +169,7 @@ PersistenceTestUtils::doPutOnDisk( { document::Document::SP doc(createRandomDocumentAtLocation( location, timestamp, minSize, maxSize)); - spi::Bucket b(makeBucket(document::BucketId(16, location), spi::PartitionId(disk))); + spi::Bucket b(makeSpiBucket(document::BucketId(16, location), spi::PartitionId(disk))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -193,12 +193,12 @@ PersistenceTestUtils::doRemoveOnDisk( spi::Trace::TraceLevel(0)); if (persistRemove) { spi::RemoveResult result = getPersistenceProvider().removeIfFound( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), timestamp, docId, context); return result.wasFound(); } spi::RemoveResult result = getPersistenceProvider().remove( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), timestamp, docId, context); return result.wasFound(); @@ -214,7 +214,7 @@ PersistenceTestUtils::doUnrevertableRemoveOnDisk( spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); spi::RemoveResult result = getPersistenceProvider().remove( - makeBucket(bucketId, spi::PartitionId(disk)), + makeSpiBucket(bucketId, spi::PartitionId(disk)), timestamp, docId, context); return result.wasFound(); } @@ -232,7 +232,7 @@ PersistenceTestUtils::doGetOnDisk( if (headerOnly) { fieldSet.reset(new document::HeaderFields()); } - return getPersistenceProvider().get(makeBucket( + return getPersistenceProvider().get(makeSpiBucket( bucketId, spi::PartitionId(disk)), *fieldSet, docId, context); } @@ -308,7 +308,7 @@ PersistenceTestUtils::doPut(const document::Document::SP& doc, spi::Timestamp time, uint16_t disk) { - spi::Bucket b(makeBucket(bid, spi::PartitionId(disk))); + spi::Bucket b(makeSpiBucket(bid, spi::PartitionId(disk))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); getPersistenceProvider().createBucket(b, context); @@ -324,7 +324,7 @@ PersistenceTestUtils::doUpdate(document::BucketId bid, spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); return getPersistenceProvider().update( - makeBucket(bid, spi::PartitionId(disk)), time, update, context); + makeSpiBucket(bid, spi::PartitionId(disk)), time, update, context); } void @@ -340,10 +340,10 @@ PersistenceTestUtils::doRemove(const document::DocumentId& id, spi::Timestamp ti spi::Trace::TraceLevel(0)); if (unrevertableRemove) { getPersistenceProvider().remove( - makeBucket(bucket, spi::PartitionId(disk)), time, id, context); + makeSpiBucket(bucket, spi::PartitionId(disk)), time, id, context); } else { spi::RemoveResult result = getPersistenceProvider().removeIfFound( - makeBucket(bucket, spi::PartitionId(disk)), time, id, context); + makeSpiBucket(bucket, spi::PartitionId(disk)), time, id, context); if (!result.wasFound()) { throw vespalib::IllegalStateException( "Attempted to remove non-existing doc " + id.toString(), diff --git a/storage/src/tests/persistence/persistencethread_splittest.cpp b/storage/src/tests/persistence/persistencethread_splittest.cpp index b6e02e88540..9c10b9987e0 100644 --- a/storage/src/tests/persistence/persistencethread_splittest.cpp +++ b/storage/src/tests/persistence/persistencethread_splittest.cpp @@ -7,7 +7,7 @@ #include <tests/persistence/persistencetestutils.h> #include <vespa/document/test/make_document_bucket.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -179,7 +179,7 @@ PersistenceThread_SplitTest::doTest(SplitCase splitCase) uint64_t splitMask = 1 << (splitLevelToDivide - 1); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); - spi::Bucket bucket(makeBucket(document::BucketId(currentSplitLevel, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(currentSplitLevel, 1))); spi::PersistenceProvider& spi(getPersistenceProvider()); spi.deleteBucket(bucket, context); spi.createBucket(bucket, context); diff --git a/storage/src/tests/persistence/provider_error_wrapper_test.cpp b/storage/src/tests/persistence/provider_error_wrapper_test.cpp index 397bc740e55..b6b87b33666 100644 --- a/storage/src/tests/persistence/provider_error_wrapper_test.cpp +++ b/storage/src/tests/persistence/provider_error_wrapper_test.cpp @@ -5,7 +5,7 @@ #include <tests/persistence/persistencetestutils.h> #include <tests/persistence/common/persistenceproviderwrapper.h> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { @@ -64,7 +64,7 @@ struct Fixture { ~Fixture() {} void perform_spi_operation() { - errorWrapper.getBucketInfo(makeBucket(document::BucketId(16, 1234))); + errorWrapper.getBucketInfo(makeSpiBucket(document::BucketId(16, 1234))); } void check_no_listener_invoked_for_error(MockErrorListener& listener, spi::Result::ErrorType error) { diff --git a/storage/src/tests/persistence/splitbitdetectortest.cpp b/storage/src/tests/persistence/splitbitdetectortest.cpp index 30904e3da3d..c20aae373ec 100644 --- a/storage/src/tests/persistence/splitbitdetectortest.cpp +++ b/storage/src/tests/persistence/splitbitdetectortest.cpp @@ -10,7 +10,7 @@ #include <vespa/document/bucket/bucketidfactory.h> #include <algorithm> -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; namespace storage { @@ -63,7 +63,7 @@ SplitBitDetectorTest::testTwoUsers() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -96,7 +96,7 @@ SplitBitDetectorTest::testSingleUser() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -123,7 +123,7 @@ SplitBitDetectorTest::testMaxBits() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); int minContentSize = 1, maxContentSize = 1; @@ -152,7 +152,7 @@ SplitBitDetectorTest::testMaxBitsOneBelowMax() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(15, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(15, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); int minContentSize = 1, maxContentSize = 1; @@ -190,7 +190,7 @@ SplitBitDetectorTest::testUnsplittable() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -218,7 +218,7 @@ SplitBitDetectorTest::testUnsplittableMinCount() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -248,7 +248,7 @@ SplitBitDetectorTest::testEmpty() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -267,7 +267,7 @@ SplitBitDetectorTest::testZeroDocLimitFallbacksToOneBitIncreaseWith1Doc() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); @@ -290,7 +290,7 @@ SplitBitDetectorTest::testZeroDocLimitFallbacksToOneBitIncreaseOnGidCollision() document::TestDocMan testDocMan; spi::dummy::DummyPersistence provider(testDocMan.getTypeRepoSP(), 1); provider.getPartitionStates(); - spi::Bucket bucket(makeBucket(document::BucketId(1, 1))); + spi::Bucket bucket(makeSpiBucket(document::BucketId(1, 1))); spi::Context context(defaultLoadType, spi::Priority(0), spi::Trace::TraceLevel(0)); diff --git a/storage/src/tests/persistence/testandsettest.cpp b/storage/src/tests/persistence/testandsettest.cpp index a19ba26e866..caf24c4a8fe 100644 --- a/storage/src/tests/persistence/testandsettest.cpp +++ b/storage/src/tests/persistence/testandsettest.cpp @@ -14,7 +14,7 @@ using std::unique_ptr; using std::shared_ptr; using namespace std::string_literals; -using storage::spi::test::makeBucket; +using storage::spi::test::makeSpiBucket; using document::test::makeDocumentBucket; namespace storage { @@ -46,7 +46,7 @@ public: createBucket(BUCKET_ID); getPersistenceProvider().createBucket( - makeBucket(BUCKET_ID), + makeSpiBucket(BUCKET_ID), context); thread = createPersistenceThread(0); |