Commit 477be1bb authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

The sorter can now queue RetrieveRequests, unit tests should be improved now

Harmonized the copyNb type to uint32_t
Corrected a bug in RetrieveQueue::getContainerSummary() --> After insertion in the queue, the number of files and bytes added were equal to 0.
parent 7039f5f6
......@@ -251,7 +251,7 @@ public:
const common::dataStructures::SecurityIdentity &admin,
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint64_t copyNb,
const uint32_t copyNb,
const std::string &tapePoolName,
const std::string &comment) = 0;
......@@ -267,11 +267,11 @@ public:
virtual void deleteArchiveRoute(
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint64_t copyNb) = 0;
const uint32_t copyNb) = 0;
virtual std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes() const = 0;
virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment) = 0;
virtual void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) = 0;
virtual void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
virtual void deleteLogicalLibrary(const std::string &name) = 0;
......
......@@ -165,11 +165,11 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->setTapePoolEncryption(admin, name, encryptionValue);}, m_maxTriesToConnect);
}
void createArchiveRoute(const common::dataStructures::SecurityIdentity &admin, const std::string &diskInstanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName, const std::string &comment) override {
void createArchiveRoute(const common::dataStructures::SecurityIdentity &admin, const std::string &diskInstanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createArchiveRoute(admin, diskInstanceName, storageClassName, copyNb, tapePoolName, comment);}, m_maxTriesToConnect);
}
void deleteArchiveRoute(const std::string &diskInstanceName, const std::string &storageClassName, const uint64_t copyNb) override {
void deleteArchiveRoute(const std::string &diskInstanceName, const std::string &storageClassName, const uint32_t copyNb) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->deleteArchiveRoute(diskInstanceName, storageClassName, copyNb);}, m_maxTriesToConnect);
}
......@@ -177,11 +177,11 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->getArchiveRoutes();}, m_maxTriesToConnect);
}
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName) override {
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteTapePoolName(admin, instanceName, storageClassName, copyNb, tapePoolName);}, m_maxTriesToConnect);
}
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment) override {
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyArchiveRouteComment(admin, instanceName, storageClassName, copyNb, comment);}, m_maxTriesToConnect);
}
......
......@@ -1341,7 +1341,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName, comment);
......@@ -1385,7 +1385,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringDiskInstanceNa
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const std::string diskInstanceName = "";
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, diskInstanceName, storageClass.name, copyNb, tapePoolName,
comment), catalogue::UserSpecifiedAnEmptyStringDiskInstanceName);
......@@ -1412,7 +1412,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringStorageClassNa
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const std::string storageClassName = "";
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClassName, copyNb,
tapePoolName, comment), catalogue::UserSpecifiedAnEmptyStringStorageClassName);
......@@ -1438,7 +1438,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_zeroCopyNb) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 0;
const uint32_t copyNb = 0;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
tapePoolName, comment), catalogue::UserSpecifiedAZeroCopyNb);
......@@ -1459,7 +1459,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringTapePoolName)
m_catalogue->createStorageClass(m_admin, storageClass);
const std::string tapePoolName = "";
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
tapePoolName, comment), catalogue::UserSpecifiedAnEmptyStringTapePoolName);
......@@ -1485,7 +1485,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_emptyStringComment) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
tapePoolName, comment), catalogue::UserSpecifiedAnEmptyStringComment);
......@@ -1507,7 +1507,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_non_existent_storage_clas
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, diskInstanceName, storageClassName, copyNb, tapePoolName,
comment), exception::UserError);
......@@ -1529,7 +1529,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_non_existent_tape_pool) {
const std::string tapePoolName = "tape_pool";
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
......@@ -1564,7 +1564,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_same_name_different_disk_
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass1DiskInstance1.diskInstance, storageClass1DiskInstance1.name,
copyNb, tapePoolName, comment);
......@@ -1616,7 +1616,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_same_twice) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName, comment);
ASSERT_THROW(m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
......@@ -1643,7 +1643,7 @@ TEST_P(cta_catalogue_CatalogueTest, deleteArchiveRoute) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName, comment);
......@@ -1696,7 +1696,7 @@ TEST_P(cta_catalogue_CatalogueTest, createArchiveRoute_deleteStorageClass) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName, comment);
......@@ -1745,7 +1745,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteTapePoolName) {
const std::string anotherTapePoolName = "another_tape_pool";
m_catalogue->createTapePool(m_admin, anotherTapePoolName, vo, nbPartialTapes, isEncrypted, "Create another tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName, comment);
......@@ -1810,7 +1810,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteTapePoolName_nonExistentAr
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
ASSERT_THROW(m_catalogue->modifyArchiveRouteTapePoolName(m_admin, storageClass.diskInstance, storageClass.name,
copyNb, tapePoolName), exception::UserError);
}
......@@ -1835,7 +1835,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteComment) {
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
comment);
......@@ -1902,7 +1902,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyArchiveRouteComment_nonExistentArchive
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string comment = "Comment";
ASSERT_THROW(m_catalogue->modifyArchiveRouteComment(m_admin, storageClass.diskInstance, storageClass.name, copyNb,
comment), exception::UserError);
......@@ -5701,7 +5701,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_no_mount_rules)
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -5786,7 +5786,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -5876,7 +5876,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_group
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -5985,7 +5985,7 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -6134,7 +6134,7 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_mount_
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -6216,7 +6216,7 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_group_
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -6317,7 +6317,7 @@ TEST_P(cta_catalogue_CatalogueTest, getArchiveFileQueueCriteria_requester_mount_
const bool isEncrypted = true;
m_catalogue->createTapePool(m_admin, tapePoolName, vo, nbPartialTapes, isEncrypted, "Create tape pool");
const uint64_t copyNb = 1;
const uint32_t copyNb = 1;
const std::string archiveRouteComment = "Create archive route";
m_catalogue->createArchiveRoute(m_admin, storageClass.diskInstance, storageClass.name, copyNb, tapePoolName,
archiveRouteComment);
......@@ -7578,7 +7578,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
}
}
for(uint64_t copyNb = 1; copyNb <= 2; copyNb++) {
for(uint32_t copyNb = 1; copyNb <= 2; copyNb++) {
const std::string vid = copyNb == 1 ? vid1 : vid2;
const uint64_t startFseq = 1;
const uint64_t maxNbFiles = nbArchiveFiles;
......@@ -7644,7 +7644,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
}
}
for(uint64_t copyNb = 1; copyNb <= 2; copyNb++) {
for(uint32_t copyNb = 1; copyNb <= 2; copyNb++) {
const std::string vid = copyNb == 1 ? vid1 : vid2;
const uint64_t startFseq = 1;
const uint64_t maxNbFiles = nbArchiveFiles / 2;
......@@ -7710,7 +7710,7 @@ TEST_P(cta_catalogue_CatalogueTest, filesWrittenToTape_many_archive_files) {
}
}
for(uint64_t copyNb = 1; copyNb <= 2; copyNb++) {
for(uint32_t copyNb = 1; copyNb <= 2; copyNb++) {
const std::string vid = copyNb == 1 ? vid1 : vid2;
const uint64_t startFseq = nbArchiveFiles / 2 + 1;
const uint64_t maxNbFiles = nbArchiveFiles / 2;
......
......@@ -35,7 +35,7 @@ public:
virtual ~DummyCatalogue() { }
void createAdminUser(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& storageClassName, const uint64_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createLogicalLibrary(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createRequesterGroupMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -45,7 +45,7 @@ public:
void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string & vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteAdminUser(const std::string& username) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveFile(const std::string& instanceName, const uint64_t archiveFileId, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveRoute(const std::string& diskInstanceName, const std::string& storageClassName, const uint64_t copyNb) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveRoute(const std::string& diskInstanceName, const std::string& storageClassName, const uint32_t copyNb) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteLogicalLibrary(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteMountPolicy(const std::string& name) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteRequesterGroupMountRule(const std::string& diskInstanceName, const std::string& requesterGroupName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -73,8 +73,8 @@ public:
std::list<TapeForWriting> getTapesForWriting(const std::string& logicalLibraryName) const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
bool isAdmin(const common::dataStructures::SecurityIdentity& admin) const { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyAdminUserComment(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint64_t copyNb, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint64_t copyNb, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyLogicalLibraryComment(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMountPolicyArchiveMinRequestAge(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t minArchiveRequestAge) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyMountPolicyArchivePriority(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -825,7 +825,7 @@ bool RdbmsCatalogue::diskFileGroupExists(rdbms::Conn &conn, const std::string &d
// archiveRouteExists
//------------------------------------------------------------------------------
bool RdbmsCatalogue::archiveRouteExists(rdbms::Conn &conn, const std::string &diskInstanceName,
const std::string &storageClassName, const uint64_t copyNb) const {
const std::string &storageClassName, const uint32_t copyNb) const {
try {
const char *const sql =
"SELECT "
......@@ -1125,7 +1125,7 @@ void RdbmsCatalogue::createArchiveRoute(
const common::dataStructures::SecurityIdentity &admin,
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint64_t copyNb,
const uint32_t copyNb,
const std::string &tapePoolName,
const std::string &comment) {
try {
......@@ -1234,7 +1234,7 @@ void RdbmsCatalogue::createArchiveRoute(
// deleteArchiveRoute
//------------------------------------------------------------------------------
void RdbmsCatalogue::deleteArchiveRoute(const std::string &diskInstanceName, const std::string &storageClassName,
const uint64_t copyNb) {
const uint32_t copyNb) {
try {
const char *const sql =
"DELETE FROM "
......@@ -1332,7 +1332,7 @@ std::list<common::dataStructures::ArchiveRoute> RdbmsCatalogue::getArchiveRoutes
// modifyArchiveRouteTapePoolName
//------------------------------------------------------------------------------
void RdbmsCatalogue::modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin,
const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb,
const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb,
const std::string &tapePoolName) {
try {
const time_t now = time(nullptr);
......@@ -1381,7 +1381,7 @@ void RdbmsCatalogue::modifyArchiveRouteTapePoolName(const common::dataStructures
// modifyArchiveRouteComment
//------------------------------------------------------------------------------
void RdbmsCatalogue::modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin,
const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb,
const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb,
const std::string &comment) {
try {
const time_t now = time(nullptr);
......@@ -4459,7 +4459,7 @@ common::dataStructures::TapeCopyToPoolMap RdbmsCatalogue::getTapeCopyToPoolMap(r
stmt.bindString(":STORAGE_CLASS_NAME", storageClass.storageClassName);
auto rset = stmt.executeQuery();
while (rset.next()) {
const uint64_t copyNb = rset.columnUint64("COPY_NB");
const uint32_t copyNb = rset.columnUint64("COPY_NB");
const std::string tapePoolName = rset.columnString("TAPE_POOL_NAME");
copyToPoolMap[copyNb] = tapePoolName;
}
......
......@@ -246,7 +246,7 @@ public:
const common::dataStructures::SecurityIdentity &admin,
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint64_t copyNb,
const uint32_t copyNb,
const std::string &tapePoolName,
const std::string &comment) override;
......@@ -263,11 +263,11 @@ public:
void deleteArchiveRoute(
const std::string &diskInstanceName,
const std::string &storageClassName,
const uint64_t copyNb) override;
const uint32_t copyNb) override;
std::list<common::dataStructures::ArchiveRoute> getArchiveRoutes() const override;
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName) override;
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment) override;
void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &tapePoolName) override;
void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &storageClassName, const uint32_t copyNb, const std::string &comment) override;
void createLogicalLibrary(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
void deleteLogicalLibrary(const std::string &name) override;
......@@ -696,7 +696,7 @@ protected:
* @return True if the archive route exists.
*/
bool archiveRouteExists(rdbms::Conn &conn, const std::string &diskInstanceName, const std::string &storageClassName,
const uint64_t copyNb) const;
const uint32_t copyNb) const;
/**
* Returns true if the specified tape exists.
......
......@@ -120,7 +120,7 @@ struct TapeFileWritten: public TapeItemWritten {
/**
* The copy number of the tape file.
*/
uint64_t copyNb;
uint32_t copyNb;
}; // struct TapeFileWritten
......
......@@ -69,7 +69,7 @@ struct ArchiveFile {
* for a single tape, the map will contain only one element.
*/
std::map<uint64_t,TapeFile> tapeFiles;
time_t creationTime;
time_t creationTime;
time_t reconciliationTime;
}; // struct ArchiveFile
......
......@@ -43,7 +43,7 @@ struct ArchiveJob {
ArchiveRequest request;
std::string tapePool;
std::string instanceName;
uint64_t copyNumber;
uint32_t copyNumber;
uint64_t archiveFileID;
std::list<std::string> failurelogs;
......
......@@ -55,7 +55,7 @@ struct ArchiveRoute {
/**
* The cipy number of the tape file.
*/
uint64_t copyNb;
uint32_t copyNb;
std::string tapePoolName;
EntryLog creationLog;
......
......@@ -64,7 +64,7 @@ struct TapeFile {
* The copy number of the file. Copy numbers start from 1. Copy number 0
* is an invalid copy number.
*/
uint16_t copyNb;
uint32_t copyNb;
/**
* The time the file recorded in the catalogue.
*/
......
......@@ -106,7 +106,7 @@ public:
struct JobDump {
uint64_t size;
std::string address;
uint16_t copyNb;
uint32_t copyNb;
};
std::list<JobDump> dumpJobs();
struct CandidateJobList {
......
......@@ -37,7 +37,7 @@ struct ContainerTraits<ArchiveQueue,C>
struct InsertedElement {
ArchiveRequest* archiveRequest;
uint16_t copyNb;
uint32_t copyNb;
cta::common::dataStructures::ArchiveFile archiveFile;
cta::optional<cta::common::dataStructures::MountPolicy> mountPolicy;
cta::optional<serializers::ArchiveJobStatus> newStatus;
......@@ -48,7 +48,7 @@ struct ContainerTraits<ArchiveQueue,C>
struct PoppedElement {
std::unique_ptr<ArchiveRequest> archiveRequest;
uint16_t copyNb;
uint32_t copyNb;
uint64_t bytes;
common::dataStructures::ArchiveFile archiveFile;
std::string srcURL;
......
......@@ -47,7 +47,7 @@ public:
struct JobInfo {
uint64_t size;
std::string address;
uint16_t copyNb;
uint32_t copyNb;
uint64_t priority;
uint64_t minArchiveRequestAge;
uint64_t maxDrivesAllowed;
......
......@@ -67,7 +67,7 @@ void ArchiveRequest::initialize() {
//------------------------------------------------------------------------------
// ArchiveRequest::addJob()
//------------------------------------------------------------------------------
void ArchiveRequest::addJob(uint16_t copyNumber,
void ArchiveRequest::addJob(uint32_t copyNumber,
const std::string& tapepool, const std::string& initialOwner,
uint16_t maxRetriesWithinMount, uint16_t maxTotalRetries, uint16_t maxReportRetries) {
checkPayloadWritable();
......@@ -89,7 +89,7 @@ void ArchiveRequest::addJob(uint16_t copyNumber,
//------------------------------------------------------------------------------
// ArchiveRequest::getJobQueueType()
//------------------------------------------------------------------------------
JobQueueType ArchiveRequest::getJobQueueType(uint16_t copyNumber) {
JobQueueType ArchiveRequest::getJobQueueType(uint32_t copyNumber) {
checkPayloadReadable();
for (auto &j: m_payload.jobs()) {
if (j.copynb() == copyNumber) {
......@@ -119,7 +119,7 @@ JobQueueType ArchiveRequest::getJobQueueType(uint16_t copyNumber) {
//------------------------------------------------------------------------------
// ArchiveRequest::addTransferFailure()
//------------------------------------------------------------------------------
auto ArchiveRequest::addTransferFailure(uint16_t copyNumber,
auto ArchiveRequest::addTransferFailure(uint32_t copyNumber,
uint64_t mountId, const std::string & failureReason, log::LogContext & lc) -> EnqueueingNextStep {
checkPayloadWritable();
// Find the job and update the number of failures
......@@ -156,7 +156,7 @@ auto ArchiveRequest::addTransferFailure(uint16_t copyNumber,
//------------------------------------------------------------------------------
// ArchiveRequest::addReportFailure()
//------------------------------------------------------------------------------
auto ArchiveRequest::addReportFailure(uint16_t copyNumber, uint64_t sessionId, const std::string& failureReason,
auto ArchiveRequest::addReportFailure(uint32_t copyNumber, uint64_t sessionId, const std::string& failureReason,
log::LogContext& lc) -> EnqueueingNextStep {
checkPayloadWritable();
// Find the job and update the number of failures
......@@ -184,7 +184,7 @@ auto ArchiveRequest::addReportFailure(uint16_t copyNumber, uint64_t sessionId, c
//------------------------------------------------------------------------------
// ArchiveRequest::getRetryStatus()
//------------------------------------------------------------------------------
ArchiveRequest::RetryStatus ArchiveRequest::getRetryStatus(const uint16_t copyNumber) {
ArchiveRequest::RetryStatus ArchiveRequest::getRetryStatus(const uint32_t copyNumber) {
checkPayloadReadable();
for (auto &j: m_payload.jobs()) {
if (copyNumber == j.copynb()) {
......@@ -478,7 +478,7 @@ void ArchiveRequest::garbageCollect(const std::string &presumedOwner, AgentRefer
// ArchiveRequest::setJobOwner()
//------------------------------------------------------------------------------
void ArchiveRequest::setJobOwner(
uint16_t copyNumber, const std::string& owner) {
uint32_t copyNumber, const std::string& owner) {
checkPayloadWritable();
// Find the right job
auto mutJobs = m_payload.mutable_jobs();
......@@ -494,7 +494,7 @@ void ArchiveRequest::setJobOwner(
//------------------------------------------------------------------------------
// ArchiveRequest::asyncUpdateJobOwner()
//------------------------------------------------------------------------------
ArchiveRequest::AsyncJobOwnerUpdater* ArchiveRequest::asyncUpdateJobOwner(uint16_t copyNumber,
ArchiveRequest::AsyncJobOwnerUpdater* ArchiveRequest::asyncUpdateJobOwner(uint32_t copyNumber,
const std::string& owner, const std::string& previousOwner, const cta::optional<serializers::ArchiveJobStatus>& newStatus) {
std::unique_ptr<AsyncJobOwnerUpdater> ret(new AsyncJobOwnerUpdater);
// The unique pointer will be std::moved so we need to work with its content (bare pointer or here ref to content).
......@@ -624,7 +624,7 @@ objectstore::serializers::ArchiveJobStatus ArchiveRequest::AsyncJobOwnerUpdater:
//------------------------------------------------------------------------------
// ArchiveRequest::asyncUpdateTransferSuccessful()
//------------------------------------------------------------------------------
ArchiveRequest::AsyncTransferSuccessfulUpdater * ArchiveRequest::asyncUpdateTransferSuccessful(const uint16_t copyNumber ) {
ArchiveRequest::AsyncTransferSuccessfulUpdater * ArchiveRequest::asyncUpdateTransferSuccessful(const uint32_t copyNumber ) {
std::unique_ptr<AsyncTransferSuccessfulUpdater> ret(new AsyncTransferSuccessfulUpdater);
// The unique pointer will be std::moved so we need to work with its content (bare pointer or here ref to content).
auto & retRef = *ret;
......@@ -698,7 +698,7 @@ void ArchiveRequest::AsyncRequestDeleter::wait() {
//------------------------------------------------------------------------------
// ArchiveRequest::getJobOwner()
//------------------------------------------------------------------------------
std::string ArchiveRequest::getJobOwner(uint16_t copyNumber) {
std::string ArchiveRequest::getJobOwner(uint32_t copyNumber) {
checkPayloadReadable();
auto jl = m_payload.jobs();
auto j=std::find_if(jl.begin(), jl.end(), [&](decltype(*jl.begin())& j2){ return j2.copynb() == copyNumber; });
......@@ -764,7 +764,7 @@ std::string ArchiveRequest::eventToString(JobEvent jobEvent) {
//------------------------------------------------------------------------------
// ArchiveRequest::determineNextStep()
//------------------------------------------------------------------------------
auto ArchiveRequest::determineNextStep(uint16_t copyNumberUpdated, JobEvent jobEvent,
auto ArchiveRequest::determineNextStep(uint32_t copyNumberUpdated, JobEvent jobEvent,
log::LogContext& lc) -> EnqueueingNextStep {
checkPayloadWritable();
// We have to determine which next step should be taken.
......@@ -865,7 +865,7 @@ std::list<std::string> ArchiveRequest::getFailures() {
//------------------------------------------------------------------------------
// ArchiveRequest::setJobStatus()
//------------------------------------------------------------------------------
void ArchiveRequest::setJobStatus(uint16_t copyNumber, const serializers::ArchiveJobStatus& status) {
void ArchiveRequest::setJobStatus(uint32_t copyNumber, const serializers::ArchiveJobStatus& status) {
checkPayloadWritable();