aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-04-04 11:45:55 +0000
committerTor Egge <Tor.Egge@oath.com>2018-04-04 11:45:55 +0000
commit8cfeaeba255ccea54f8345724e72adf53280e33d (patch)
tree711593ee26f3688371e0b0ae948247df22ee54d0 /storage
parent7902239839a6f34e12ed7aa0f2b7a65114f8ee68 (diff)
Stop using nested typedef for shared pointer to const DocumentTypeRepo.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/bucketdb/bucketmanagertest.cpp2
-rw-r--r--storage/src/tests/common/teststorageapp.cpp2
-rw-r--r--storage/src/tests/common/teststorageapp.h4
-rw-r--r--storage/src/tests/distributor/distributortestutil.cpp2
-rw-r--r--storage/src/tests/distributor/distributortestutil.h2
-rw-r--r--storage/src/tests/distributor/getoperationtest.cpp2
-rw-r--r--storage/src/tests/distributor/operationtargetresolvertest.cpp2
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp2
-rw-r--r--storage/src/tests/distributor/twophaseupdateoperationtest.cpp2
-rw-r--r--storage/src/tests/distributor/updateoperationtest.cpp2
-rw-r--r--storage/src/tests/persistence/persistencetestutils.h2
-rw-r--r--storage/src/tests/storageserver/documentapiconvertertest.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h6
-rw-r--r--storage/src/vespa/storage/storageserver/communicationmanager.cpp2
-rw-r--r--storage/src/vespa/storage/storageserver/communicationmanager.h2
-rw-r--r--storage/src/vespa/storage/storageserver/storagenode.cpp2
-rw-r--r--storage/src/vespa/storage/visiting/visitorthread.cpp2
19 files changed, 22 insertions, 22 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp
index 8cc046861be..0c7122547db 100644
--- a/storage/src/tests/bucketdb/bucketmanagertest.cpp
+++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp
@@ -199,7 +199,7 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer,
assert(system(getMkDirDisk(rootFolder, 0).c_str()) == 0);
assert(system(getMkDirDisk(rootFolder, 1).c_str()) == 0);
- DocumentTypeRepo::SP repo(new DocumentTypeRepo(
+ std::shared_ptr<const DocumentTypeRepo> repo(new DocumentTypeRepo(
*ConfigGetter<DocumenttypesConfig>::getConfig(
"config-doctypes", FileSpec(TEST_PATH("config-doctypes.cfg")))));
_top.reset(new DummyStorageLink);
diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp
index 95237d1bfcb..8fd80d47bb3 100644
--- a/storage/src/tests/common/teststorageapp.cpp
+++ b/storage/src/tests/common/teststorageapp.cpp
@@ -90,7 +90,7 @@ TestStorageApp::setDistribution(Redundancy redundancy, NodeCount nodeCount)
}
void
-TestStorageApp::setTypeRepo(document::DocumentTypeRepo::SP repo)
+TestStorageApp::setTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo)
{
_compReg.setDocumentTypeRepo(repo);
}
diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h
index 369cdedc583..867ac9d38fc 100644
--- a/storage/src/tests/common/teststorageapp.h
+++ b/storage/src/tests/common/teststorageapp.h
@@ -68,14 +68,14 @@ public:
// Set functions, to be able to modify content while running.
void setDistribution(Redundancy, NodeCount);
- void setTypeRepo(document::DocumentTypeRepo::SP repo);
+ void setTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo);
void setClusterState(const lib::ClusterState&);
// Utility functions for getting a hold of currently used bits. Practical
// to avoid adding extra components in the tests.
StorageComponentRegisterImpl& getComponentRegister() { return _compReg; }
document::TestDocMan& getTestDocMan() { return _docMan; }
- document::DocumentTypeRepo::SP getTypeRepo()
+ std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo()
{ return _compReg.getTypeRepo(); }
const document::BucketIdFactory& getBucketIdFactory()
{ return _compReg.getBucketIdFactory(); }
diff --git a/storage/src/tests/distributor/distributortestutil.cpp b/storage/src/tests/distributor/distributortestutil.cpp
index 33167d61026..e43161946fb 100644
--- a/storage/src/tests/distributor/distributortestutil.cpp
+++ b/storage/src/tests/distributor/distributortestutil.cpp
@@ -83,7 +83,7 @@ DistributorTestUtil::triggerDistributionChange(lib::Distribution::SP distr)
}
void
-DistributorTestUtil::setTypeRepo(const document::DocumentTypeRepo::SP &repo)
+DistributorTestUtil::setTypeRepo(const std::shared_ptr<const document::DocumentTypeRepo> &repo)
{
_node->getComponentRegister().setDocumentTypeRepo(repo);
}
diff --git a/storage/src/tests/distributor/distributortestutil.h b/storage/src/tests/distributor/distributortestutil.h
index c2cb4fb2a62..69b5a5cdf6a 100644
--- a/storage/src/tests/distributor/distributortestutil.h
+++ b/storage/src/tests/distributor/distributortestutil.h
@@ -35,7 +35,7 @@ public:
* Sets up the storage link chain.
*/
void createLinks();
- void setTypeRepo(const document::DocumentTypeRepo::SP &repo);
+ void setTypeRepo(const std::shared_ptr<const document::DocumentTypeRepo> &repo);
void close();
diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp
index 80636bd33a7..064348539bf 100644
--- a/storage/src/tests/distributor/getoperationtest.cpp
+++ b/storage/src/tests/distributor/getoperationtest.cpp
@@ -43,7 +43,7 @@ class GetOperationTest : public CppUnit::TestFixture, public DistributorTestUtil
CPPUNIT_TEST(canGetDocumentsWhenAllReplicaNodesRetired);
CPPUNIT_TEST_SUITE_END();
- document::DocumentTypeRepo::SP _repo;
+ std::shared_ptr<const document::DocumentTypeRepo> _repo;
public:
document::DocumentId docId;
diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp
index fe5373a936f..17dbf007c63 100644
--- a/storage/src/tests/distributor/operationtargetresolvertest.cpp
+++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp
@@ -27,7 +27,7 @@ struct OperationTargetResolverTest : public CppUnit::TestFixture,
public DistributorTestUtil
{
- document::DocumentTypeRepo::SP _repo;
+ std::shared_ptr<const document::DocumentTypeRepo> _repo;
const document::DocumentType* _html_type;
std::unique_ptr<Operation> op;
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index 776e0275f68..b43d3cf64ad 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -59,7 +59,7 @@ class PutOperationTest : public CppUnit::TestFixture,
CPPUNIT_TEST(replicaNotImplicitlyActivatedWhenActivationIsDisabled);
CPPUNIT_TEST_SUITE_END();
- DocumentTypeRepo::SP _repo;
+ std::shared_ptr<const DocumentTypeRepo> _repo;
const DocumentType* _html_type;
std::unique_ptr<Operation> op;
diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
index ed961b29b1c..29d50b1b9b7 100644
--- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
+++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
@@ -68,7 +68,7 @@ class TwoPhaseUpdateOperationTest : public CppUnit::TestFixture,
CPPUNIT_TEST_SUITE_END();
document::TestDocRepo _testRepo;
- DocumentTypeRepo::SP _repo;
+ std::shared_ptr<const DocumentTypeRepo> _repo;
const DocumentType* _doc_type;
protected:
diff --git a/storage/src/tests/distributor/updateoperationtest.cpp b/storage/src/tests/distributor/updateoperationtest.cpp
index c15a2b4057c..ccbee0093ba 100644
--- a/storage/src/tests/distributor/updateoperationtest.cpp
+++ b/storage/src/tests/distributor/updateoperationtest.cpp
@@ -35,7 +35,7 @@ class UpdateOperation_Test : public CppUnit::TestFixture,
CPPUNIT_TEST(testMultiNodeInconsistentTimestamp);
CPPUNIT_TEST_SUITE_END();
- DocumentTypeRepo::SP _repo;
+ std::shared_ptr<const DocumentTypeRepo> _repo;
const DocumentType *_html_type;
protected:
diff --git a/storage/src/tests/persistence/persistencetestutils.h b/storage/src/tests/persistence/persistencetestutils.h
index 36b1fef7285..22ab954cc6a 100644
--- a/storage/src/tests/persistence/persistencetestutils.h
+++ b/storage/src/tests/persistence/persistencetestutils.h
@@ -62,7 +62,7 @@ public:
FileStorHandler& fsHandler() { return *_env->_handler; }
FileStorMetrics& metrics() { return _env->_metrics; }
MessageKeeper& messageKeeper() { return _env->_messageKeeper; }
- document::DocumentTypeRepo::SP getTypeRepo() { return _env->_component.getTypeRepo(); }
+ std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _env->_component.getTypeRepo(); }
StorageComponent& getComponent() { return _env->_component; }
TestServiceLayerApp& getNode() { return _env->_node; }
diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp
index caf498cb272..1c38107cb06 100644
--- a/storage/src/tests/storageserver/documentapiconvertertest.cpp
+++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp
@@ -61,7 +61,7 @@ struct DocumentApiConverterTest : public CppUnit::TestFixture
{
std::shared_ptr<MockBucketResolver> _bucketResolver;
std::unique_ptr<DocumentApiConverter> _converter;
- const DocumentTypeRepo::SP _repo;
+ const std::shared_ptr<const DocumentTypeRepo> _repo;
const DataType& _html_type;
DocumentApiConverterTest()
diff --git a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
index febba2cf16d..cf3eed09bf0 100644
--- a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
@@ -39,7 +39,7 @@ RemoveLocationOperation::getBucketId(
DistributorComponent& manager,
const api::RemoveLocationCommand& cmd, document::BucketId& bid)
{
- document::DocumentTypeRepo::SP repo =
+ std::shared_ptr<const document::DocumentTypeRepo> repo =
manager.getTypeRepo();
document::select::Parser parser(
*repo, manager.getBucketIdFactory());
diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
index 62598bce402..0a172ccd4e2 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
@@ -77,7 +77,7 @@ StorageComponentRegisterImpl::setNodeStateUpdater(NodeStateUpdater& updater)
}
void
-StorageComponentRegisterImpl::setDocumentTypeRepo(document::DocumentTypeRepo::SP repo)
+StorageComponentRegisterImpl::setDocumentTypeRepo(std::shared_ptr<const document::DocumentTypeRepo> repo)
{
vespalib::LockGuard lock(_componentLock);
_docTypeRepo = repo;
diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
index ffa91afd931..a3b6b58e806 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
+++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
@@ -30,7 +30,7 @@ class StorageComponentRegisterImpl
vespalib::string _clusterName;
const lib::NodeType* _nodeType;
uint16_t _index;
- document::DocumentTypeRepo::SP _docTypeRepo;
+ std::shared_ptr<const document::DocumentTypeRepo> _docTypeRepo;
documentapi::LoadTypeSet::SP _loadTypes;
PriorityConfig _priorityConfig;
document::BucketIdFactory _bucketIdFactory;
@@ -49,7 +49,7 @@ public:
const lib::NodeType& getNodeType() const
{ assert(_nodeType != 0); return *_nodeType; }
uint16_t getIndex() const { return _index; }
- document::DocumentTypeRepo::SP getTypeRepo() { return _docTypeRepo; }
+ std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _docTypeRepo; }
documentapi::LoadTypeSet::SP getLoadTypes() { return _loadTypes; }
const document::BucketIdFactory& getBucketIdFactory() { return _bucketIdFactory; }
lib::Distribution::SP getDistribution() { return _distribution; }
@@ -62,7 +62,7 @@ public:
const lib::NodeType& nodeType,
uint16_t index);
virtual void setNodeStateUpdater(NodeStateUpdater& updater);
- virtual void setDocumentTypeRepo(document::DocumentTypeRepo::SP);
+ virtual void setDocumentTypeRepo(std::shared_ptr<const document::DocumentTypeRepo>);
virtual void setLoadTypes(documentapi::LoadTypeSet::SP);
virtual void setPriorityConfig(const PriorityConfig&);
virtual void setBucketIdFactory(const document::BucketIdFactory&);
diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
index 105f1c25cca..4a50c015526 100644
--- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp
+++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
@@ -767,7 +767,7 @@ CommunicationManager::print(std::ostream& out, bool verbose, const std::string&
}
void CommunicationManager::updateMessagebusProtocol(
- const document::DocumentTypeRepo::SP &repo) {
+ const std::shared_ptr<const document::DocumentTypeRepo> &repo) {
if (_mbus.get()) {
framework::SecondTime now(_component.getClock().getTimeInSeconds());
auto newDocumentProtocol = std::make_shared<documentapi::DocumentProtocol>(*_component.getLoadTypes(), repo);
diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.h b/storage/src/vespa/storage/storageserver/communicationmanager.h
index 5c7d5812fdb..1e777258bbb 100644
--- a/storage/src/vespa/storage/storageserver/communicationmanager.h
+++ b/storage/src/vespa/storage/storageserver/communicationmanager.h
@@ -176,7 +176,7 @@ public:
std::unique_ptr<mbus::Message> mbusMsg, const mbus::Route& route);
void handleReply(std::unique_ptr<mbus::Reply> msg) override;
- void updateMessagebusProtocol(const document::DocumentTypeRepo::SP &repo);
+ void updateMessagebusProtocol(const std::shared_ptr<const document::DocumentTypeRepo> &repo);
void updateBucketSpacesConfig(const BucketspacesConfig&);
const CommunicationManagerMetrics& metrics() const noexcept { return _metrics; }
diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp
index aa5475df823..ad98d64b173 100644
--- a/storage/src/vespa/storage/storageserver/storagenode.cpp
+++ b/storage/src/vespa/storage/storageserver/storagenode.cpp
@@ -249,7 +249,7 @@ StorageNode::initializeStatusWebServer()
if (DIFFER(a)) { LOG(warning, "Live config failure: %s.", b); }
void
-StorageNode::setNewDocumentRepo(const document::DocumentTypeRepo::SP& repo)
+StorageNode::setNewDocumentRepo(const std::shared_ptr<const document::DocumentTypeRepo>& repo)
{
vespalib::LockGuard configLockGuard(_configLock);
_context.getComponentRegister().setDocumentTypeRepo(repo);
diff --git a/storage/src/vespa/storage/visiting/visitorthread.cpp b/storage/src/vespa/storage/visiting/visitorthread.cpp
index 4743ac66054..718e88a2917 100644
--- a/storage/src/vespa/storage/visiting/visitorthread.cpp
+++ b/storage/src/vespa/storage/visiting/visitorthread.cpp
@@ -497,7 +497,7 @@ VisitorThread::onCreateVisitor(
// Parse document selection
try{
if (cmd->getDocumentSelection() != "") {
- document::DocumentTypeRepo::SP repo(
+ std::shared_ptr<const document::DocumentTypeRepo> repo(
_component.getTypeRepo());
const document::BucketIdFactory& idFactory(
_component.getBucketIdFactory());