diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-17 18:31:29 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-17 18:31:29 +0000 |
commit | 8e5767e8d878d59c082ade3ef51f991a81338220 (patch) | |
tree | 5c86157e0449947fafd57c0a904018bc9173fcb5 /storage/src/tests/persistence | |
parent | ab3518e8b3a4caf742e12a134c4fb1d2bbf3c293 (diff) |
Move removeLocation over to Asynchandler and issue all removes for one bucket before waiting for the replies.
Prepare RemoveResult to contain more replies.
Diffstat (limited to 'storage/src/tests/persistence')
-rw-r--r-- | storage/src/tests/persistence/processalltest.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/storage/src/tests/persistence/processalltest.cpp b/storage/src/tests/persistence/processalltest.cpp index 80047a1797c..18242e62873 100644 --- a/storage/src/tests/persistence/processalltest.cpp +++ b/storage/src/tests/persistence/processalltest.cpp @@ -2,6 +2,7 @@ #include <vespa/document/base/testdocman.h> #include <vespa/storage/persistence/processallhandler.h> +#include <vespa/storage/persistence/asynchandler.h> #include <vespa/storage/persistence/messages.h> #include <tests/persistence/persistencetestutils.h> #include <vespa/document/test/make_document_bucket.h> @@ -36,7 +37,8 @@ TEST_F(ProcessAllHandlerTest, remove_location) { document::Bucket bucket = makeDocumentBucket(bucketId); auto cmd = std::make_shared<api::RemoveLocationCommand>("id.user == 4", bucket); - ProcessAllHandler handler(getEnv(), getPersistenceProvider()); + document::BucketIdFactory bucketIdFactory; + AsyncHandler handler(getEnv(), getPersistenceProvider(), _bucketOwnershipNotifier, *_sequenceTaskExecutor, bucketIdFactory); auto tracker = handler.handleRemoveLocation(*cmd, createTracker(cmd, bucket)); EXPECT_EQ("DocEntry(1234, 1, id:mail:testdoctype1:n=4:3619.html)\n" @@ -50,7 +52,8 @@ TEST_F(ProcessAllHandlerTest, remove_location) { TEST_F(ProcessAllHandlerTest, remove_location_document_subset) { document::BucketId bucketId(16, 4); - ProcessAllHandler handler(getEnv(), getPersistenceProvider()); + document::BucketIdFactory bucketIdFactory; + AsyncHandler handler(getEnv(), getPersistenceProvider(), _bucketOwnershipNotifier, *_sequenceTaskExecutor, bucketIdFactory); document::TestDocMan docMan; for (int i = 0; i < 10; ++i) { @@ -87,7 +90,8 @@ TEST_F(ProcessAllHandlerTest, remove_location_throws_exception_on_unknown_doc_ty document::Bucket bucket = makeDocumentBucket(bucketId); auto cmd = std::make_shared<api::RemoveLocationCommand>("unknowndoctype.headerval % 2 == 0", bucket); - ProcessAllHandler handler(getEnv(), getPersistenceProvider()); + document::BucketIdFactory bucketIdFactory; + AsyncHandler handler(getEnv(), getPersistenceProvider(), _bucketOwnershipNotifier, *_sequenceTaskExecutor, bucketIdFactory); ASSERT_THROW(handler.handleRemoveLocation(*cmd, createTracker(cmd, bucket)), std::exception); EXPECT_EQ("DocEntry(1234, 0, Doc(id:mail:testdoctype1:n=4:3619.html))\n", @@ -101,7 +105,8 @@ TEST_F(ProcessAllHandlerTest, remove_location_throws_exception_on_bogus_selectio document::Bucket bucket = makeDocumentBucket(bucketId); auto cmd = std::make_shared<api::RemoveLocationCommand>("id.bogus != badgers", bucket); - ProcessAllHandler handler(getEnv(), getPersistenceProvider()); + document::BucketIdFactory bucketIdFactory; + AsyncHandler handler(getEnv(), getPersistenceProvider(), _bucketOwnershipNotifier, *_sequenceTaskExecutor, bucketIdFactory); ASSERT_THROW(handler.handleRemoveLocation(*cmd, createTracker(cmd, bucket)), std::exception); EXPECT_EQ("DocEntry(1234, 0, Doc(id:mail:testdoctype1:n=4:3619.html))\n", |