Commit 89c1cefb authored by Steven Murray's avatar Steven Murray
Browse files

Revert "Revert "Made Catalogue a pure interface (removed m_log)""

This reverts commit fc001693.

The CI was incorrectly failing.  There was nothing wrong with
the original commit that made the Catalogue class a pure
interface.
parent fc001693
......@@ -21,12 +21,6 @@
namespace cta {
namespace catalogue {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
Catalogue::Catalogue(log::Logger &log): m_log(log) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
......
......@@ -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
......
......@@ -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"); }
......
......@@ -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) {
......
......@@ -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.
*/
......
......@@ -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
......
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment