Commit a432ab1a authored by Eric Cano's avatar Eric Cano
Browse files

#533: moved DiskSystem back to disk directory.

parent b1bc436e
......@@ -165,7 +165,7 @@ set_property(TARGET ctainmemorycatalogueunittests PROPERTY SOVERSION "${CTA_SOVE
set_property(TARGET ctainmemorycatalogueunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctainmemorycatalogueunittests
ctacatalogue)
ctacatalogue ctadisk)
install (TARGETS ctainmemorycatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......
......@@ -55,7 +55,7 @@
#include "common/dataStructures/UserIdentity.hpp"
#include "common/dataStructures/VidToTapeMap.hpp"
#include "common/dataStructures/WriteTestResult.hpp"
#include "common/dataStructures/DiskSystem.hpp"
#include "disk/DiskSystem.hpp"
#include "common/exception/UserError.hpp"
#include "common/log/LogContext.hpp"
#include "common/log/Logger.hpp"
......@@ -498,7 +498,7 @@ public:
* @return The disk systems.
* requester group.
*/
virtual common::dataStructures::DiskSystemList getAllDiskSystems() const = 0;
virtual disk::DiskSystemList getAllDiskSystems() const = 0;
/**
* Creates a disk system.
......
......@@ -361,7 +361,7 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->getActivitiesFairShareWeights();}, m_maxTriesToConnect);
}
common::dataStructures::DiskSystemList getAllDiskSystems() const override {
disk::DiskSystemList getAllDiskSystems() const override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->getAllDiskSystems();}, m_maxTriesToConnect);
}
......
......@@ -57,7 +57,7 @@ public:
void deleteTapePool(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void filesWrittenToTape(const std::set<TapeItemWrittenPointer>& event) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
std::list<common::dataStructures::ActivitiesFairShareWeights> getActivitiesFairShareWeights() const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::DiskSystemList getAllDiskSystems() const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
disk::DiskSystemList getAllDiskSystems() const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createDiskSystem(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &fileRegexp, const std::string &freeSpaceQueryURL, const uint64_t refreshInterval, const uint64_t targetedFreeSpace, const std::string &comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteDiskSystem(const std::string &name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyDiskSystemFileRegexp(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &fileRegexp) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented");}
......
......@@ -4247,9 +4247,9 @@ std::list<common::dataStructures::ActivitiesFairShareWeights> RdbmsCatalogue::ge
//------------------------------------------------------------------------------
// getAllDiskSystems
//------------------------------------------------------------------------------
common::dataStructures::DiskSystemList RdbmsCatalogue::getAllDiskSystems() const {
disk::DiskSystemList RdbmsCatalogue::getAllDiskSystems() const {
try {
common::dataStructures::DiskSystemList diskSystemList;
disk::DiskSystemList diskSystemList;
std::string sql =
"SELECT "
"DISK_SYSTEM.DISK_SYSTEM_NAME AS DISK_SYSTEM_NAME,"
......@@ -4275,7 +4275,7 @@ common::dataStructures::DiskSystemList RdbmsCatalogue::getAllDiskSystems() const
auto rset = stmt.executeQuery();
while (rset.next()) {
common::dataStructures::DiskSystem diskSystem;
disk::DiskSystem diskSystem;
diskSystem.name = rset.columnString("DISK_SYSTEM_NAME");
diskSystem.fileRegexp = rset.columnString("FILE_REGEXP");
diskSystem.freeSpaceQueryURL = rset.columnString("FREE_SPACE_QUERY_URL");
......
......@@ -511,7 +511,7 @@ public:
* @return The disk systems.
* requester group.
*/
common::dataStructures::DiskSystemList getAllDiskSystems() const override;
disk::DiskSystemList getAllDiskSystems() const override;
/**
* Creates a disk system.
......
......@@ -41,7 +41,6 @@ set (COMMON_LIB_SRC_FILES
dataStructures/DeleteArchiveRequest.cpp
dataStructures/DesiredDriveState.cpp
dataStructures/DiskFileInfo.cpp
dataStructures/DiskSystem.cpp
dataStructures/DriveState.cpp
dataStructures/DriveStatus.cpp
dataStructures/EntryLog.cpp
......
......@@ -27,6 +27,7 @@ add_library(ctadisk SHARED
EOSReporter.cpp
DiskFile.cpp
RadosStriperPool.cpp
DiskSystem.cpp
)
target_link_libraries (ctadisk XrdCl cryptopp radosstriper)
......
......@@ -21,8 +21,7 @@
#include <algorithm>
namespace cta {
namespace common {
namespace dataStructures {
namespace disk {
const DiskSystem& DiskSystemList::at(const std::string& name) {
auto dsi = std::find_if(begin(), end(), [&](const DiskSystem& ds){ return ds.name == name;});
......@@ -50,6 +49,4 @@ std::string DiskSystemList::getFSNAme(const std::string& fileURL) {
}
} // namespace dataStructures
} // namespace common
} // namespace cta
\ No newline at end of file
}} // namespace cta::disk
\ No newline at end of file
......@@ -18,14 +18,12 @@
#pragma once
#include <string>
#include <list>
#include "common/utils/Regex.hpp"
#include "common/dataStructures/EntryLog.hpp"
#include <string>
#include <list>
namespace cta {
namespace common {
namespace dataStructures {
namespace cta { namespace disk {
/**
* Description of a disk system as defined by operators.
......@@ -43,7 +41,6 @@ struct DiskSystem {
std::string freeSpaceQueryURL;
uint64_t refreshInterval;
uint64_t targetedFreeSpace;
cta::common::dataStructures::EntryLog creationLog;
cta::common::dataStructures::EntryLog lastModificationLog;
std::string comment;
......@@ -69,6 +66,5 @@ private:
};
} // namespace dataStructures
} // namespace common
} // namespace cta
}} // namespace cta::common
......@@ -3443,7 +3443,7 @@ const OStoreDB::RetrieveMount::MountInfo& OStoreDB::RetrieveMount::getMountInfo(
// OStoreDB::RetrieveMount::getNextJobBatch()
//------------------------------------------------------------------------------
std::list<std::unique_ptr<SchedulerDatabase::RetrieveJob>> OStoreDB::RetrieveMount::getNextJobBatch(uint64_t filesRequested,
uint64_t bytesRequested, common::dataStructures::DiskSystemList& diskSystemList, log::LogContext& logContext) {
uint64_t bytesRequested, disk::DiskSystemList& diskSystemList, log::LogContext& logContext) {
typedef objectstore::ContainerAlgorithms<RetrieveQueue,RetrieveQueueToTransferForUser> RQAlgos;
RQAlgos rqAlgos(m_oStoreDB.m_objectStore, *m_oStoreDB.m_agentReference);
RQAlgos::PopCriteria popCriteria(filesRequested, bytesRequested);
......
......@@ -218,7 +218,7 @@ public:
public:
const MountInfo & getMountInfo() override;
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> > getNextJobBatch(uint64_t filesRequested, uint64_t bytesRequested,
common::dataStructures::DiskSystemList& diskSystemList, log::LogContext& logContext) override;
disk::DiskSystemList& diskSystemList, log::LogContext& logContext) override;
void complete(time_t completionTime) override;
void setDriveStatus(cta::common::dataStructures::DriveStatus status, time_t completionTime) override;
void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) override;
......
......@@ -138,7 +138,7 @@ std::list<std::unique_ptr<cta::RetrieveJob> > cta::RetrieveMount::getNextJobBatc
if (!m_sessionRunning)
throw SessionNotRunning("In RetrieveMount::getNextJobBatch(): trying to get job from complete/not started session");
// Get the current file systems list from the catalogue
common::dataStructures::DiskSystemList diskSystemList;
disk::DiskSystemList diskSystemList;
if (m_catalogue) diskSystemList = m_catalogue->getAllDiskSystems();
// Try and get a new job from the DB
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob>> dbJobBatch(m_dbMount->getNextJobBatch(filesRequested,
......
......@@ -33,7 +33,7 @@
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/RepackInfo.hpp"
#include "common/dataStructures/SecurityIdentity.hpp"
#include "common/dataStructures/DiskSystem.hpp"
#include "disk/DiskSystem.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp"
#include "common/exception/Exception.hpp"
#include "common/log/LogContext.hpp"
......@@ -358,7 +358,7 @@ public:
} mountInfo;
virtual const MountInfo & getMountInfo() = 0;
virtual std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob>> getNextJobBatch(uint64_t filesRequested,
uint64_t bytesRequested, common::dataStructures::DiskSystemList & diskSystemList, log::LogContext& logContext) = 0;
uint64_t bytesRequested, disk::DiskSystemList & diskSystemList, log::LogContext& logContext) = 0;
virtual void complete(time_t completionTime) = 0;
virtual void setDriveStatus(common::dataStructures::DriveStatus status, time_t completionTime) = 0;
virtual void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) = 0;
......
......@@ -315,8 +315,10 @@ TEST_P(SchedulerDatabaseTest, popRetrieveRequestsWithDisksytem) {
// Create the disk system list
cta::disk::DiskSystemList diskSystemList;
diskSystemList.push_back(cta::disk::DiskSystem{"ds-A", "$root://a.disk.system/", "query:todo", 60, 10UL*1000*1000*1000});
diskSystemList.push_back(cta::disk::DiskSystem{"ds-B", "$root://b.disk.system/", "query:todo", 60, 10UL*1000*1000*1000});
diskSystemList.push_back(cta::disk::DiskSystem{"ds-A", "$root://a.disk.system/", "query:todo", 60, 10UL*1000*1000*1000,
common::dataStructures::EntryLog(), common::dataStructures::EntryLog{},"No comment"});
diskSystemList.push_back(cta::disk::DiskSystem{"ds-B", "$root://b.disk.system/", "query:todo", 60, 10UL*1000*1000*1000,
common::dataStructures::EntryLog(), common::dataStructures::EntryLog{},"No comment"});
// Inject 10 retrieve jobs to the db.
const size_t filesToDo = 10;
......
......@@ -43,7 +43,7 @@ namespace unitTests{
class TestingDatabaseRetrieveMount: public cta::SchedulerDatabase::RetrieveMount {
const MountInfo & getMountInfo() override { throw std::runtime_error("Not implemented"); }
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> > getNextJobBatch(uint64_t filesRequested, uint64_t bytesRequested,
cta::common::dataStructures::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
cta::disk::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
void complete(time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setDriveStatus(cta::common::dataStructures::DriveStatus status, time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) override { throw std::runtime_error("Not implemented"); }
......
......@@ -36,7 +36,7 @@ namespace unitTests{
class TestingDatabaseRetrieveMount: public cta::SchedulerDatabase::RetrieveMount {
const MountInfo & getMountInfo() override { throw std::runtime_error("Not implemented"); }
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> > getNextJobBatch(uint64_t filesRequested, uint64_t bytesRequested, cta::common::dataStructures::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> > getNextJobBatch(uint64_t filesRequested, uint64_t bytesRequested, cta::disk::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
void complete(time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setDriveStatus(cta::common::dataStructures::DriveStatus status, time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) override { throw std::runtime_error("Not implemented"); }
......
......@@ -132,7 +132,7 @@ namespace unitTests
class TestingDatabaseRetrieveMount: public cta::SchedulerDatabase::RetrieveMount {
const MountInfo & getMountInfo() override { throw std::runtime_error("Not implemented"); }
std::list<std::unique_ptr<cta::SchedulerDatabase::RetrieveJob> > getNextJobBatch(uint64_t filesRequested, uint64_t bytesRequested,
cta::common::dataStructures::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
cta::disk::DiskSystemList& diskSystemList, cta::log::LogContext& logContext) override { throw std::runtime_error("Not implemented");}
void complete(time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setDriveStatus(cta::common::dataStructures::DriveStatus status, time_t completionTime) override { throw std::runtime_error("Not implemented"); }
void setTapeSessionStats(const castor::tape::tapeserver::daemon::TapeSessionStats &stats) override { throw std::runtime_error("Not implemented"); }
......
......@@ -61,6 +61,7 @@ target_link_libraries(cta-rdbmsUnitTests
ctadbconfigconnunittests
ctadbconfigstmtunittests
ctardbmsunittests
ctadisk
gtest
pthread)
......
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