diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2023-10-24 15:02:22 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2023-10-24 15:16:23 +0000 |
commit | 81c7abb70e1385464698b22410fd9e43edd90cb0 (patch) | |
tree | 0ab2f375d1486cb8a0dcb59567a2ce28b2c54ebe /storage/src/tests | |
parent | 08ca78b605bc69621bb44f5bd24147cdfe3679b5 (diff) |
Rewire `FileStorManager` config
Diffstat (limited to 'storage/src/tests')
4 files changed, 22 insertions, 11 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp index 52ac6f7dba1..7a2c22553f7 100644 --- a/storage/src/tests/bucketdb/bucketmanagertest.cpp +++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp @@ -158,7 +158,9 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer, bool noD _bottom = bottom.get(); _top->push_back(std::move(bottom)); } else { - auto bottom = std::make_unique<FileStorManager>(config::ConfigUri(config.getConfigId()), + using vespa::config::content::StorFilestorConfig; + auto filestor_cfg = config_from<StorFilestorConfig>(config_uri); + auto bottom = std::make_unique<FileStorManager>(*filestor_cfg, _node->getPersistenceProvider(), _node->getComponentRegister(), *_node, _node->get_host_info()); _top->push_back(std::move(bottom)); diff --git a/storage/src/tests/persistence/common/filestortestfixture.cpp b/storage/src/tests/persistence/common/filestortestfixture.cpp index c989acd5228..74d34fb0f50 100644 --- a/storage/src/tests/persistence/common/filestortestfixture.cpp +++ b/storage/src/tests/persistence/common/filestortestfixture.cpp @@ -1,15 +1,17 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/storage/persistence/messages.h> -#include <vespa/storage/persistence/filestorage/filestormanager.h> -#include <vespa/storageapi/message/bucket.h> -#include <vespa/persistence/dummyimpl/dummypersistence.h> +#include <tests/common/testhelper.h> #include <tests/persistence/common/filestortestfixture.h> -#include <vespa/document/repo/documenttyperepo.h> +#include <vespa/config/helper/configgetter.hpp> #include <vespa/document/fieldset/fieldsets.h> +#include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/test/make_document_bucket.h> -#include <vespa/vdslib/state/clusterstate.h> +#include <vespa/persistence/dummyimpl/dummypersistence.h> #include <vespa/persistence/spi/test.h> +#include <vespa/storage/persistence/filestorage/filestormanager.h> +#include <vespa/storage/persistence/messages.h> +#include <vespa/storageapi/message/bucket.h> +#include <vespa/vdslib/state/clusterstate.h> #include <sstream> using storage::spi::test::makeSpiBucket; @@ -73,7 +75,9 @@ FileStorTestFixture::TestFileStorComponents::TestFileStorComponents( manager(nullptr) { injector.inject(top); - auto fsm = std::make_unique<FileStorManager>(config::ConfigUri(fixture._config->getConfigId()), fixture._node->getPersistenceProvider(), + using vespa::config::content::StorFilestorConfig; + auto config = config_from<StorFilestorConfig>(config::ConfigUri(fixture._config->getConfigId())); + auto fsm = std::make_unique<FileStorManager>(*config, fixture._node->getPersistenceProvider(), fixture._node->getComponentRegister(), *fixture._node, fixture._node->get_host_info()); manager = fsm.get(); top.push_back(std::move(fsm)); diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index b09febce408..586863251c9 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -5,6 +5,7 @@ #include <tests/common/teststorageapp.h> #include <tests/persistence/filestorage/forwardingmessagesender.h> #include <vespa/config/common/exceptions.h> +#include <vespa/config/helper/configgetter.hpp> #include <vespa/document/fieldset/fieldsets.h> #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/select/parser.h> @@ -223,8 +224,10 @@ struct TestFileStorComponents { explicit TestFileStorComponents(FileStorTestBase& test, bool use_small_config = false) : manager(nullptr) { - auto fsm = std::make_unique<FileStorManager>(config::ConfigUri((use_small_config ? test.smallConfig : test.config)->getConfigId()), - test._node->getPersistenceProvider(), + using vespa::config::content::StorFilestorConfig; + auto config_uri = config::ConfigUri((use_small_config ? test.smallConfig : test.config)->getConfigId()); + auto config = config_from<StorFilestorConfig>(config_uri); + auto fsm = std::make_unique<FileStorManager>(*config, test._node->getPersistenceProvider(), test._node->getComponentRegister(), *test._node, test._node->get_host_info()); manager = fsm.get(); top.push_back(std::move(fsm)); diff --git a/storage/src/tests/visiting/visitormanagertest.cpp b/storage/src/tests/visiting/visitormanagertest.cpp index d4047bc9a72..4fb857f9e67 100644 --- a/storage/src/tests/visiting/visitormanagertest.cpp +++ b/storage/src/tests/visiting/visitormanagertest.cpp @@ -98,7 +98,9 @@ VisitorManagerTest::initializeTest(bool defer_manager_thread_start) defer_manager_thread_start); _manager = vm.get(); _top->push_back(std::move(vm)); - _top->push_back(std::make_unique<FileStorManager>(config::ConfigUri(config.getConfigId()), _node->getPersistenceProvider(), + using vespa::config::content::StorFilestorConfig; + auto filestor_cfg = config_from<StorFilestorConfig>(config::ConfigUri(config.getConfigId())); + _top->push_back(std::make_unique<FileStorManager>(*filestor_cfg, _node->getPersistenceProvider(), _node->getComponentRegister(), *_node, _node->get_host_info())); _manager->setTimeBetweenTicks(10); _top->open(); |