diff --git a/catalogue/Catalogue.cpp b/catalogue/Catalogue.cpp index b958c14715ea9db3cfd5120fc646a7bd485a1536..a0866c30ba3a4f2894d03a13d37c25d1b4c554b3 100644 --- a/catalogue/Catalogue.cpp +++ b/catalogue/Catalogue.cpp @@ -21,12 +21,6 @@ namespace cta { namespace catalogue { -//------------------------------------------------------------------------------ -// constructor -//------------------------------------------------------------------------------ -Catalogue::Catalogue(log::Logger &log): m_log(log) { -} - //------------------------------------------------------------------------------ // destructor //------------------------------------------------------------------------------ diff --git a/catalogue/Catalogue.hpp b/catalogue/Catalogue.hpp index 790551652df0e6d616e1265162a1318643316989..49502f95771f9f161f039e93bc88dc43ed83d98f 100644 --- a/catalogue/Catalogue.hpp +++ b/catalogue/Catalogue.hpp @@ -77,12 +77,6 @@ namespace catalogue { */ class Catalogue { public: - /** - * Constructor. - * - * @param log Object representing the API to the CTA logging system. - */ - Catalogue(log::Logger &log); /** * Destructor. @@ -586,13 +580,6 @@ public: */ virtual bool tapeExists(const std::string &vid) const = 0; -protected: - - /** - * Object representing the API to the CTA logging system. - */ - log::Logger &m_log; - }; // class Catalogue } // namespace catalogue diff --git a/catalogue/DummyCatalogue.hpp b/catalogue/DummyCatalogue.hpp index 1e84cf92ad86f38bf87a15faa58e339c9838da4f..008c80c32863c8c744eed87370a5c7b72bb501ec 100644 --- a/catalogue/DummyCatalogue.hpp +++ b/catalogue/DummyCatalogue.hpp @@ -31,7 +31,7 @@ namespace catalogue { */ class DummyCatalogue: public Catalogue { public: - DummyCatalogue(log::Logger &l): Catalogue(l) {} + DummyCatalogue() {} virtual ~DummyCatalogue() { } void createAdminHost(const common::dataStructures::SecurityIdentity& admin, const std::string& hostName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } diff --git a/catalogue/RdbmsCatalogue.cpp b/catalogue/RdbmsCatalogue.cpp index 2e4f3b613123d36ed2fbd792d7dc8dddcb84143c..cdea6a3a304c45e5ad1722d23782b59c99166e58 100644 --- a/catalogue/RdbmsCatalogue.cpp +++ b/catalogue/RdbmsCatalogue.cpp @@ -47,7 +47,7 @@ RdbmsCatalogue::RdbmsCatalogue( const uint64_t nbConns, const uint64_t nbArchiveFileListingConns, const uint32_t maxTriesToConnect): - Catalogue(log), + m_log(log), m_connPool(login, nbConns), m_archiveFileListingConnPool(login, nbArchiveFileListingConns), m_maxTriesToConnect(maxTriesToConnect) { diff --git a/catalogue/RdbmsCatalogue.hpp b/catalogue/RdbmsCatalogue.hpp index 2b57b7fb858d8f484c43539218401e8d965cf07d..d15b4dfefd207f53c3019edce2857362eca98364 100644 --- a/catalogue/RdbmsCatalogue.hpp +++ b/catalogue/RdbmsCatalogue.hpp @@ -534,6 +534,11 @@ public: protected: + /** + * Object representing the API to the CTA logging system. + */ + log::Logger &m_log; + /** * Mutex to be used to a take a global lock on the database. */ diff --git a/objectstore/GarbageCollectorTest.cpp b/objectstore/GarbageCollectorTest.cpp index 092df08f8e6fb77b76d9fafef87e696631e57162..68d51ed8b43a3ec70f531c21babadcf69cf75d39 100644 --- a/objectstore/GarbageCollectorTest.cpp +++ b/objectstore/GarbageCollectorTest.cpp @@ -44,7 +44,7 @@ namespace unitTests { TEST(ObjectStore, GarbageCollectorBasicFuctionnality) { // We will need a log object cta::log::DummyLogger dl("unitTest"); - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; cta::log::LogContext lc(dl); // Here we check for the ability to detect dead (but empty agents) // and clean them up. @@ -98,7 +98,7 @@ TEST(ObjectStore, GarbageCollectorRegister) { // We will need a log object cta::log::DummyLogger dl("unitTest"); cta::log::LogContext lc(dl); - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; // Here we check that can successfully call agentRegister's garbage collector cta::objectstore::BackendVFS be; cta::objectstore::AgentReference agentRef("unitTestGarbageCollector", dl); @@ -158,7 +158,7 @@ TEST(ObjectStore, GarbageCollectorArchiveQueue) { cta::log::DummyLogger dl("unitTest"); cta::log::LogContext lc(dl); // We need a dummy catalogue - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; // Here we check that can successfully call agentRegister's garbage collector cta::objectstore::BackendVFS be; cta::objectstore::AgentReference agentRef("unitTestGarbageCollector", dl); @@ -218,7 +218,7 @@ TEST(ObjectStore, GarbageCollectorDriveRegister) { cta::log::DummyLogger dl("unitTest"); cta::log::LogContext lc(dl); // We need a dummy catalogue - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; // Here we check that can successfully call agentRegister's garbage collector cta::objectstore::BackendVFS be; cta::objectstore::AgentReference agentRef("unitTestGarbageCollector", dl); @@ -282,7 +282,7 @@ TEST(ObjectStore, GarbageCollectorArchiveRequest) { #endif cta::log::LogContext lc(dl); // We need a dummy catalogue - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; // Here we check that can successfully call ArchiveRequests's garbage collector cta::objectstore::BackendVFS be; // Create the root entry @@ -480,7 +480,7 @@ TEST(ObjectStore, GarbageCollectorRetrieveRequest) { #endif cta::log::LogContext lc(dl); // We need a dummy catalogue - cta::catalogue::DummyCatalogue catalogue(dl); + cta::catalogue::DummyCatalogue catalogue; // Here we check that can successfully call RetrieveRequests's garbage collector cta::objectstore::BackendVFS be; // Create the root entry diff --git a/scheduler/OStoreDB/OStoreDBFactory.hpp b/scheduler/OStoreDB/OStoreDBFactory.hpp index 6aeb7f25e3f5ea8370d85637e81a7cb27ab3af52..6080c3be9e93eb2e6a8ec158a147c29e7f447dd9 100644 --- a/scheduler/OStoreDB/OStoreDBFactory.hpp +++ b/scheduler/OStoreDB/OStoreDBFactory.hpp @@ -171,7 +171,7 @@ template <> OStoreDBWrapper<cta::objectstore::BackendVFS>::OStoreDBWrapper( const std::string &context, const std::string &URL) : m_logger(new cta::log::DummyLogger("")), m_backend(new cta::objectstore::BackendVFS()), -m_catalogue(new cta::catalogue::DummyCatalogue(*m_logger)), +m_catalogue(new cta::catalogue::DummyCatalogue), m_OStoreDB(*m_backend, *m_catalogue, *m_logger), m_agentReference("OStoreDBFactory", *m_logger) { // We need to populate the root entry before using. objectstore::RootEntry re(*m_backend); @@ -198,7 +198,7 @@ template <> OStoreDBWrapper<cta::objectstore::BackendRados>::OStoreDBWrapper( const std::string &context, const std::string &URL) : m_logger(new cta::log::DummyLogger("")), m_backend(cta::objectstore::BackendFactory::createBackend(URL, *m_logger).release()), -m_catalogue(new cta::catalogue::DummyCatalogue(*m_logger)), +m_catalogue(new cta::catalogue::DummyCatalogue), m_OStoreDB(*m_backend, *m_catalogue, *m_logger), m_agentReference("OStoreDBFactory", *m_logger) { // We need to first clean up possible left overs in the pool auto l = m_backend->list();