Commit 76de9bad authored by Steven Murray's avatar Steven Murray
Browse files

Renamed dataStructures::ArchiveFileQueueCriteria to ArchiveFileQueueCriteriaAndFileId

parent 7b570a5d
......@@ -27,7 +27,7 @@
#include "common/dataStructures/AdminHost.hpp"
#include "common/dataStructures/AdminUser.hpp"
#include "common/dataStructures/ArchiveFile.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteria.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteriaAndFileId.hpp"
#include "common/dataStructures/ArchiveFileSummary.hpp"
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveRoute.hpp"
......@@ -111,7 +111,7 @@ public:
* archiving the file.
* @return The information required to queue the associated archive request.
*/
virtual common::dataStructures::ArchiveFileQueueCriteria prepareForNewFile(
virtual common::dataStructures::ArchiveFileQueueCriteriaAndFileId prepareForNewFile(
const std::string &diskInstanceName,
const std::string &storageClassName,
const common::dataStructures::UserIdentity &user) = 0;
......
......@@ -68,7 +68,7 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->tapeLabelled(vid, drive, lbpIsOn);}, m_maxTriesToConnect);
}
common::dataStructures::ArchiveFileQueueCriteria prepareForNewFile( const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override {
common::dataStructures::ArchiveFileQueueCriteriaAndFileId prepareForNewFile( const std::string &diskInstanceName, const std::string &storageClassName, const common::dataStructures::UserIdentity &user) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->prepareForNewFile(diskInstanceName, storageClassName, user);}, m_maxTriesToConnect);
}
......
......@@ -4667,7 +4667,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareForNewFile_requester_mount_rule) {
userIdentity.group = "group";
uint64_t expectedArchiveFileId = 0;
for(uint64_t i = 0; i<10; i++) {
const common::dataStructures::ArchiveFileQueueCriteria queueCriteria =
const common::dataStructures::ArchiveFileQueueCriteriaAndFileId queueCriteria =
m_catalogue->prepareForNewFile(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
......@@ -4766,7 +4766,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareForNewFile_requester_group_mount_rule
userIdentity.group = requesterGroupName;
uint64_t expectedArchiveFileId = 0;
for(uint64_t i = 0; i<10; i++) {
const common::dataStructures::ArchiveFileQueueCriteria queueCriteria =
const common::dataStructures::ArchiveFileQueueCriteriaAndFileId queueCriteria =
m_catalogue->prepareForNewFile(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
......@@ -4884,7 +4884,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareForNewFile_requester_mount_rule_overi
userIdentity.group = "group";
uint64_t expectedArchiveFileId = 0;
for(uint64_t i = 0; i<10; i++) {
const common::dataStructures::ArchiveFileQueueCriteria queueCriteria =
const common::dataStructures::ArchiveFileQueueCriteriaAndFileId queueCriteria =
m_catalogue->prepareForNewFile(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
......
......@@ -99,7 +99,7 @@ public:
void modifyTapeTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void noSpaceLeftOnTape(const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void ping() override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::ArchiveFileQueueCriteria prepareForNewFile(const std::string& diskInstanceName, const std::string& storageClassName, const common::dataStructures::UserIdentity& user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::ArchiveFileQueueCriteriaAndFileId prepareForNewFile(const std::string& diskInstanceName, const std::string& storageClassName, const common::dataStructures::UserIdentity& user) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFile(const std::string& instanceName, const uint64_t archiveFileId, const common::dataStructures::UserIdentity& user, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
common::dataStructures::RetrieveFileQueueCriteria prepareToRetrieveFileByDiskFileId(const std::string &diskInstanceName, const std::string &diskFileId, const common::dataStructures::UserIdentity &user, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void reclaimTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -3916,7 +3916,8 @@ void RdbmsCatalogue::tapeLabelled(const std::string &vid, const std::string &dri
//------------------------------------------------------------------------------
// prepareForNewFile
//------------------------------------------------------------------------------
common::dataStructures::ArchiveFileQueueCriteria RdbmsCatalogue::prepareForNewFile(const std::string &diskInstanceName,
common::dataStructures::ArchiveFileQueueCriteriaAndFileId RdbmsCatalogue::prepareForNewFile(
const std::string &diskInstanceName,
const std::string &storageClassName, const common::dataStructures::UserIdentity &user) {
try {
auto conn = m_connPool.getConn();
......@@ -3958,7 +3959,7 @@ common::dataStructures::ArchiveFileQueueCriteria RdbmsCatalogue::prepareForNewFi
// consume an archive file identifier
const uint64_t archiveFileId = getNextArchiveFileId(conn);
return common::dataStructures::ArchiveFileQueueCriteria(archiveFileId, copyToPoolMap, mountPolicy);
return common::dataStructures::ArchiveFileQueueCriteriaAndFileId(archiveFileId, copyToPoolMap, mountPolicy);
} catch(exception::LostDatabaseConnection &le) {
throw exception::LostDatabaseConnection(std::string(__FUNCTION__) + " failed: " + le.getMessage().str());
} catch(exception::UserError &) {
......
......@@ -116,7 +116,7 @@ public:
* archiving the file.
* @return The information required to queue the associated archive request.
*/
common::dataStructures::ArchiveFileQueueCriteria prepareForNewFile(
common::dataStructures::ArchiveFileQueueCriteriaAndFileId prepareForNewFile(
const std::string &diskInstanceName,
const std::string &storageClassName,
const common::dataStructures::UserIdentity &user) override;
......
......@@ -31,7 +31,7 @@ set (COMMON_LIB_SRC_FILES
dataStructures/AdminHost.cpp
dataStructures/AdminUser.cpp
dataStructures/ArchiveFile.cpp
dataStructures/ArchiveFileQueueCriteria.cpp
dataStructures/ArchiveFileQueueCriteriaAndFileId.cpp
dataStructures/ArchiveFileSummary.cpp
dataStructures/ArchiveJob.cpp
dataStructures/ArchiveRequest.cpp
......
......@@ -16,19 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/dataStructures/ArchiveFileQueueCriteria.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteriaAndFileId.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileQueueCriteria::
ArchiveFileQueueCriteria(): fileId(0) {
cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId::
ArchiveFileQueueCriteriaAndFileId(): fileId(0) {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileQueueCriteria::ArchiveFileQueueCriteria(
cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId::ArchiveFileQueueCriteriaAndFileId(
const uint64_t fileId,
const TapeCopyToPoolMap &copyToPoolMap,
const MountPolicy &mountPolicy):
......
......@@ -33,12 +33,12 @@ namespace dataStructures {
* the corresponding data-transfer jobs are to be queued and which mount policy
* should be used.
*/
struct ArchiveFileQueueCriteria {
struct ArchiveFileQueueCriteriaAndFileId {
/**
* Constructor.
*/
ArchiveFileQueueCriteria();
ArchiveFileQueueCriteriaAndFileId();
/**
* Constructor.
......@@ -47,7 +47,7 @@ struct ArchiveFileQueueCriteria {
* @param copyToPoolMap The map from tape copy number to tape pool name.
* @param mountPolicy The mount policy.
*/
ArchiveFileQueueCriteria(
ArchiveFileQueueCriteriaAndFileId(
const uint64_t fileId,
const TapeCopyToPoolMap &copyToPoolMap,
const MountPolicy &mountPolicy);
......@@ -68,7 +68,7 @@ struct ArchiveFileQueueCriteria {
*/
MountPolicy mountPolicy;
}; // struct ArchiveFileQueueCriteria
}; // struct ArchiveFileQueueCriteriaAndFileId
} // namespace dataStructures
} // namespace common
......
......@@ -358,7 +358,7 @@ OStoreDB::TapeMountDecisionInfoNoLock::~TapeMountDecisionInfoNoLock() {}
// OStoreDB::queueArchive()
//------------------------------------------------------------------------------
void OStoreDB::queueArchive(const std::string &instanceName, const cta::common::dataStructures::ArchiveRequest &request,
const cta::common::dataStructures::ArchiveFileQueueCriteria &criteria, log::LogContext &logContext) {
const cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId &criteria, log::LogContext &logContext) {
assertAgentAddressSet();
cta::utils::Timer timer;
// Construct the archive request object in memory
......
......@@ -203,7 +203,7 @@ public:
CTA_GENERATE_EXCEPTION_CLASS(NoSuchArchiveQueue);
void queueArchive(const std::string &instanceName, const cta::common::dataStructures::ArchiveRequest &request,
const cta::common::dataStructures::ArchiveFileQueueCriteria &criteria, log::LogContext &logContext) override;
const cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId &criteria, log::LogContext &logContext) override;
CTA_GENERATE_EXCEPTION_CLASS(ArchiveRequestAlreadyDeleted);
class ArchiveToFileRequestCancelation:
......
......@@ -80,7 +80,7 @@ public:
m_OStoreDB.ping();
}
void queueArchive(const std::string &instanceName, const cta::common::dataStructures::ArchiveRequest& request, const cta::common::dataStructures::ArchiveFileQueueCriteria& criteria, log::LogContext &logContext) override {
void queueArchive(const std::string &instanceName, const cta::common::dataStructures::ArchiveRequest& request, const cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId& criteria, log::LogContext &logContext) override {
return m_OStoreDB.queueArchive(instanceName, request, criteria, logContext);
}
......
......@@ -120,7 +120,7 @@ TEST_P(OStoreDBTest, getBatchArchiveJob) {
// Add jobs to an archive queue.
for (size_t i=0; i<10; i++) {
cta::common::dataStructures::ArchiveRequest ar;
cta::common::dataStructures::ArchiveFileQueueCriteria afqc;
cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId afqc;
ar.fileSize=123*(i+1);
afqc.copyToPoolMap[1] = "Tapepool1";
afqc.fileId = i;
......
......@@ -27,7 +27,7 @@
#include "common/dataStructures/ArchiveJob.hpp"
#include "common/dataStructures/ArchiveFile.hpp"
#include "common/dataStructures/ArchiveRequest.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteria.hpp"
#include "common/dataStructures/ArchiveFileQueueCriteriaAndFileId.hpp"
#include "common/dataStructures/DriveInfo.hpp"
#include "common/dataStructures/MountType.hpp"
#include "common/dataStructures/MountPolicy.hpp"
......@@ -104,7 +104,7 @@ public:
* @param logContext context allowing logging db operation
*/
virtual void queueArchive(const std::string &instanceName, const cta::common::dataStructures::ArchiveRequest &request,
const cta::common::dataStructures::ArchiveFileQueueCriteria &criteria,
const cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId &criteria,
log::LogContext &logContext) = 0;
/**
......
......@@ -153,7 +153,7 @@ TEST_P(SchedulerDatabaseTest, createManyArchiveJobs) {
[i,&db,&lc](){
cta::common::dataStructures::ArchiveRequest ar;
cta::log::LogContext locallc=lc;
cta::common::dataStructures::ArchiveFileQueueCriteria afqc;
cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId afqc;
afqc.copyToPoolMap.insert({1, "tapePool"});
afqc.fileId = 0;
afqc.mountPolicy.name = "mountPolicy";
......@@ -233,7 +233,7 @@ TEST_P(SchedulerDatabaseTest, createManyArchiveJobs) {
[i,&db,&lc](){
cta::common::dataStructures::ArchiveRequest ar;
cta::log::LogContext locallc=lc;
cta::common::dataStructures::ArchiveFileQueueCriteria afqc;
cta::common::dataStructures::ArchiveFileQueueCriteriaAndFileId afqc;
afqc.copyToPoolMap.insert({1, "tapePool"});
afqc.fileId = 0;
afqc.mountPolicy.name = "mountPolicy";
......
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